Pulses are supplied in different amounts, at high frequency according to the position of your accelerator pedal.
Effectively, it divides the time that the motor is on versus the off time to give a smooth adjustment of the dc voltage according to the throttle or accelerator pedals position.
This means that you can have the effect or feel, of a gasoline engine's variability in revolutions but with the major benefit of the high torque of an electric motor...
The accelerator pedal is made of optical potentiometers or variable resistors that allows the smooth adjustment of speed to take place...
Watch this video for a look at how a controller works in a car...