
A bare LED is a light-emitting diode. A diode is made to let current flow much more easily in one direction than the other. Put the right polarity across the LED and charge carriers meet in the material inside it. Some of the energy they release comes out as light.
What happens with the polarity reversed?
The diode normally allows very little current in that direction, so it stays dark. Too much reverse voltage can damage it. In the forward direction, the circuit also needs a way to keep the current from getting too high.
Why does an LED bulb work on AC then?
An LED bulb made for a wall socket has electronics between the socket and the LEDs. Those electronics turn the wall’s AC into power the LEDs can use and control how much current goes through them. The little LED inside still has a forward direction.
For more on current and polarity, see Basics of Electric Utilities 101.