PWM and DC motor speed
The idea of the PWM speed control of a motor is that you switch the motor on and off between between 0V and its max operating voltage at a fast rate. It is common to use a frequency that is higher than the range of hearing so that this fast switching is not creating an annoying noise in your head. 

The actual speed of the motor becomes related to the length of time the fast switching time has the voltage attached to the motor versus the length of time the voltage to the motor is switched off. This time relationship is referred to as the duty cycle of the signal. Change the duty cycle and the speed changes.