When there is a great difference among the positive electrons of cloud in upper part and negative electrons of cloud in the lower. Then an energy discharge takes place causing the lightening to strike within the cloud and when there is enough difference of charge between one cloud and another lightening takes place to maintain the balance. In this case difference is too much. Earth is charged before having circuit with cloud. This is because the charge between the clouds and earth alters. Striking occurs between cloud and earth. First the earth gets positively charged then a closed circuit is formed by it.
Lightening is a huge electric spark caused when ice and water are rubbed together. It is believed that lightening strikes only the tall trees, building etc but it is all myth.
Precipitation theorists say that different raindrops, graupel, hail etc gets charged. When they strike with negatively charged heavier particles in the cloud lightening takes place.
When graupel comes in contact with the additional ice crystals and water droplets, rising particle sheared off electrons charged negatively and it collides with falling particles which result in a cloud which is charged negatively from the base and positively on the top. An electric field is created within the cloud as opposite attract each other, positive charge attracts negative charge, moreover the attraction will be strong if these regions are more apart.
A current of electricity makes its way through atmosphere as it is a good insulator. When it finds something which can make good connection a lightening stroke takes place.