Let us see what the book entitled Meteorology Today, says on this. It says that clouds become electrified as hail falls through a region in the could of supercooled droplets and ice crystals. As liquid droplets collide with hail, they freeze on contact and release latent heat. This keeps the surface of the hail warmer than that of the surrounding ice crystals. When the hail comes in contact with and ice crystal, and important phenomenon occurs.
Electrons flow from the colder oblect toward the warmer object.
Hence, the hail become negatively charged, The same effect occurs when super cooled droplets come in contact with a piece of hail and tiny splinters of positively charged ice break off. These lighter, positively charged particles are then carried to the upper part of the could by updrafts. The hail, left with a negative charge, fall toward the bottom of the cloud, thus the lower part of the cloud becomes negatively charged. These negative charges are then discharged to the ground as lightning. We conclude from this that hail is the major factor in producing lightning.