What is the main cause of lightning?

Lightning happens when the negative charges (electrons) in the bottom of the cloud are attracted to the positive charges (protons) in the ground.