This circuit demonstrates the difference between a pure sine wave vs. a simulated sine wave via PWM. The voltage labeled in green is the pure sine wave, and the voltage labeled blue is the approximated sine wave using a bunch of tiny square waves.
This circuit just SIMULATES PWM though. This is not the best/most efficient way to achieve a smooth voltage wave. I would not recommend trying this at home.