A speed controller is a device which operates an electric motor at a variety of speeds. They are commonly found in industrial control and R/C (radio controlled) vehicle applications. Power output of an electric motor is governed both by the input voltage and by overall current. The voltage determines the speed, and the current the peak torque, which will limit the speed under load.
There are just a few primary methods of controlling the speed of a DC motor. The first and most obvious is to use a variable resistor to change resistance in the circuit, which will reduce voltage (but not current) and thus change the overall power. There are two problems with this approach. Firstly, you are dissipating electrical energy as heat energy, which is inefficient. The second is that you can pass no more current to the motor than your resistor can handle.
The second method is to use a mechanical switch or a series of relays in conjunction with fixed resistors to provide a variety of speeds. This is the method most commonly used in older radio controlled cars; There is a carrier with a number of contacts, and a wiper which will touch them which is driven by a R/C servo. Low speed is provided by the use of a large ceramic resistor, while high speed is the electrical equivalent of "wide open throttle", with no added resistance.
A third method, also used in R/C, is to provide pulse code modulated or pulse width modulated power to the motor, generally with inline capacitors to smooth out the wave. This has the advantage that less power is lost, though it must be done too quickly for relays to be effective, and transistors do heat up when they are switched off, or when a lot of current passes through them. For this reason, RC speed controllers (which in extreme cases pass more than 10 amperes of current) tend to have multiple transistors which are employed either in rapid succession or used in parallel.
Modern R/C speed controllers also provide advanced features like regenerative braking and ABS. Regenerative braking is done by operating the pulsed power in reverse, from the motor to the battery. When the amount of power being generated by the motor (electric motors will operate as a generator if kinetic force is applied to the "output" shaft) drops too low, then the wheels are not turning, and the rate of the pulses is decreased, meaning that the load is decreased. This causes the wheels to not "lock up", thus providing ABS braking.