During the development of a thunderstorm, the air currents move in upward direction while the water droplets move in downward direction. These movements cause separation of charges. The positive charges collect near the upper edges of the clouds and negative charges collect near the lower edges of the clouds.
Accumulation of positive charges near the ground due to induction also takes place. When the magnitude of collected charges becomes large, the air cannot resist their flow and as a result, negative and positive charges meet producing streaks of bright light and sound, called lightning.