Question: why use pwm instead of analog?
Answer: PWM can also effect the sound of your motors. -> It's more efficient to use PWM compared to, say, a resistor in series, as a lot power is dissipated through the resistor. It's also much easier to output a PWM pulse and is typically built into microcontroller's hardware nowadays.