The mains voltage is AC that swings positive then negative over and over.
The LED works from DC so the rectifier diode rectifies the mains voltage so it produces only humps of positive voltage.
The LED lights each half cycle of the mains that is a positive voltage.