A light-emitting diode (LED) emits light by applying a forward current to the pn junction of a compound semiconductor.
When forward current is passed through the light-emitting diode, carriers (electrons and holes) move. The holes in the p-type region move to the n-type region and the electrons in the n-type region move to the p-type region. The injected carriers recombine, and the energy difference before and after recombination is released as light. The emitted light depends on the energy band gap (Eg) of the compound semiconductor.
(Remark: Conventional Si diodes do not emit light because the recombination energy becomes thermal energy.)