It is safer, simpler and more robust to control DC motors using a digital (on-off) signal rather than an analog signal. PWM does this by smoothing the current. EMF voltage is smoothened also by mechanical effect. See Pulse Width Modulation.
The width of each pulse determines the average voltage supplied to the motor. Narrow pulses represent a low average voltage, while wide pulses correspond to a higher average voltage. This approach allows for fine control over the motor’s speed and torque.
Smoothing – the voltage-current relation in an inductive circuit is given by:
where the inductor integrates the voltage over time, leading to a more continuous current flow.
The EMF voltage is also smoothed out due to mechanical effects, making the motor respond more smoothly