LEDs function based on the principle of electroluminescence, where light is produced due to an electric current passing through a semiconductor material.