The water droplets and ice crystals in the upper regions of the atmosphere collide with each other due to swift rising of the air. These collisions produce static electricity and the clouds get charged. This results in huge sparking between the clouds or between the clouds and the ground. This is called lightning.