It’s useful to think of an LED as a current-driven device. The light output is proportional to the drive current over a decent range. But things go a bit odd at the bottom end of the current range, where the LED may flicker or change color. So dimming by reductions in forward current isn’t the most useful technique.
Instead, pulse width modulation presents a technique to safely dim an LED from 0-100% of its nominal brightness. By pulsing the LED with current, and varying the duty cycle of the current waveform, The LED rapidly transitions between on and off, and the relative times spent give the impression of being dimmed.
For a little more information on the current-limiting approach, see: How is LED brightness related to current?