Thunderstorms form when a particularly warm, moist air mass rises into cold air above land or sea.
As the humid air rises to a great height, water vapour condenses, forming huge cumulonimbus clouds. Water droplets and ice crystals in the cloud bump together and break up. This action builds up positive charges at the top of the cloud and negative charges at the base. When the charge at the base of the cloud gets to a certain strength, electrical energy is released and passes through the air to another point with the opposite charge eg. This release of energy is called the leader stroke and forms a path of charged air for the main stroke to travel along.