An LED works by allowing the electric current to pass through its semiconducting material (the diode). This leads to the diode emitting photons, which is light, through the electroluminescence principle.