The voltage at the end of PN junction forms a certain potential barrier. When the forward bias voltage is applied, the barrier decreases, and most carriers in P and N zones diffuse to each other. Since the electron mobility is much larger than the hole mobility, a large number of electrons will diffuse into the P-region, constituting the injection of minority carriers in the P-region. These electrons combine with holes in the valence band, and the resulting energy is released as light energy. That's how the PN junction emits light.