GPIO generally only supports discrete outputs.
But for some types of hardware, like LEDs and some motors, the system has some inertia, and if you switch on and off fast enough, you get a result similar to having an intermediate voltage.
So with pulse width modulation we can fake analog output from digital output in a good enough manner.