The AC source symbolizes noise or EMI introduced to the circuit.
Flipping the switch to open, you see the LED flickering and burning out due to extreme noise.
Flipping the switch to closed, you see a much steadier voltage across the LED. This is the purpose of capacitors in DC circuits.