When the surface of the earth is heated by solar radiation, the moist air on the surface is warmed and becomes an updraft, which forms water droplets in the sky, and these droplets form clouds.
As the ambient temperature reaches below freezing in the sky, ice particles as well as raindrops form in the clouds. These ice particles grow and become larger as they rise. When they grow to a certain size and gravity overcomes the force of the updraft, they begin to descend.
As the ice grains collide with each other, the smaller grains are charged with positive charges and the larger grains with negative charges. In addition, the upper part of the cloud is charged with a positive charge and the lower part with a negative charge. When this phenomenon continues, thunderclouds (cumulonimbus clouds) are formed. At the same time, due to the electrostatic induction effect, a positive charge accumulates on the ground surface corresponding to the negative charge below the thundercloud.
As the thundercloud grows, the force of electricity becomes stronger, and the positive charge and negative charge try to attract each other. When the air can no longer withstand the force of the electricity, it discharges, and lightning occurs. The positive and negative charges are attracted to each other and discharge in the air. The lightning that occurs in clouds or between thunderclouds is cloud discharge, and the lightning that occurs between clouds and the earth is so-called lightning strike.