LEDs work on the principle of electroluminescence, where electrons recombine with holes within a semiconductor material, releasing energy in the form of photons. This process is highly efficient and can be tuned to produce light of various wavelengths, from infrared to ultraviolet.