Thunderstorms occur mainly in summer. Strong sunlight causes a lot of water to evaporate and heats the air. When a cold front approaches, the cold air slides under the warm air, causing the moist warm air to rise. The water vapor condenses and cumulus clouds form, which can eventually grow into a cumulonimbus (Cb). Strong updrafts in the Cb prevent smaller raindrops from falling out of the cloud.
The raindrops and ice pellets are repeatedly carried upward, where they freeze and accumulate new ice. This process repeats until the ice pellets become too heavy to be supported by the updrafts. Then either very large cold raindrops, graupel, or even hailstones fall from the Cb. The updrafts in the cloud and the uneven distribution of ice and water create areas with different charges. The upper part of the Cb is usually positively charged and the lower part negatively. When the voltage between the different charges becomes very large, lightning occurs. Either a voltage equalization takes place within the cloud or between the ground and the lower part of the cloud. In rare cases, a positively charged lightning can also occur between the upper part of the Cb and the ground. For lightning between cloud and earth, the voltage difference must be more than 100 million volts.
The air around the lightning channel is suddenly heated to about 40,000°C. This leads to a rapid expansion of the air, causing the thunder. Since sound, unlike light, has a speed of only 330 meters per second, the distance of the lightning can be calculated from the time between lightning and thunder (3 seconds corresponds to about one kilometer).