Clouds become electrically charged,the upper portion is positively charged and the lower portion is negatively charged.There are many explanation for how the cloud acquire charge,the best explanation is that electric charge is due to the collision between ice,water and water vapor. When the electric field in the cloud increases and increases,electrons in the cloud start to repel electrons in the ground surface causing it to become positively charged.Now,we have negative charge - air-positive charge (see figure),but air is an insulator and the lightning needs a path,here comes air ionization process where air become ionized .Then what’s called a stepped leader which is an invisible discharged path that moves downward from cloud to ground.And another leader is then created upward from Earth to cloud.When both make contact visible lightning occurs.