system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does PWM (Pulse Width Modulation) work?

Im looking to get into Arduino and frequently see the term PWM used in projects that use Arduino but with an extremely basic knowledge of electronics i'm finding online explanations difficult to understand.
gpt
It's like playing with a ceiling fan switch: the speed of the fan is not going to drop instantly down to zero the instant you turn the switch off, nor is it going to get to max speed the second you turn it on. So, using this delay, you can switch it on and off, on and off, making it faster or slower, to make it go the speed you want at the time you want. (Dammit, driving was a much better example but oh, well.)

Suppose you want the current delivered to a component to be in the form of a particular signal (maybe a sine-wave of so-and-so frequency, or going up then down, etc.)

But the only control you have is to switch the power supply on and off.

You can switch the supply on and off very fast, in a pattern, rapidly sometimes and slower other times, to effectively controlledly 'push' the average signal higher and lower in discrete steps as needed.

The switching on-and-off is the pulse. The duration for which is the pulse is held is the pulse-width. And modulation is the function of all this: to end up with the signal you want.