PWM is a way to fake an analog signal from a digital signal. Instead of outputting an analog signal in the middle of the range, the digital signal is turned on and off at rate that results in an average at the desired analog level (for example, rapidly turning a 5V signal on and off at equal intervals would result in a signal that appears to be 2.5V).
This is a convenient way to fake an analog signal without a real ADC but it has some disadvantages too. For one thing, it doesn’t always work and can cause anything from annoying flickering to outright not working as with some motors.
Bending a piece of metal, like a coat-hanger or soda-can–tab will eventually cause metal-fatigue and break it. Likewise, repeatedly heating and cooling an incandescent light-bulb will cause it to die sooner. Does rapidly turning some electronics components on and off, LEDs in particular, damage or break them or shorten their lifespan? 🤔