When a DC source is connected to a capacitor and a LED, and the voltage is removed when capacitor is charged, the capacitor supplies current to it for some time. What happens if this DC source is changed to AC source. Don't hate.:)
Because an LED acts like a diode, the negative current from the AC source will be clipped and the capacitor will always be charged and it will act like a second voltage source. Look at my picture below. You can see that the green line represents the voltage going through the capacitor and the blue line (it's a little hard to see since it's covered up by the green line) is behaving the same way as it represents the voltage across the LED (or the output voltage).