Due to the rising of humid air thunderstorm is formed. Air rises up because of many factors like heating by sun, melting of two different steams of air or facing of air uphill. This heated air rises up and condense at a certain height forming a cloud. If it rises further water droplets condense to form ice crystals. When it reaches the height of approximately 10 or 20 kilometers cumulonimbus clouds are formed and they cause thunderstorm. In these clouds upper parts are charged positively and the lower and the middle negatively. Because of great turbulence in cloud water droplets and ice crystals are broken and they get charged electrically. Now discharge happens between the same cloud or two clouds or cloud and an earth surface. Because the difference between positive and negative charge lightening happens it produces a huge amount of heat energy and results in the expansion of neighboring air which causes thunder.
The conditions present in the atmosphere, thunderstorm passes through three stages. It can take minimum of 20 minutes and maximum few hours.
Cumlus stage-: in this water vapor rises due to many reasons like heating by sun etc. rising up high vapors condense in water droplets and then to ice crystals. The escaped heat energy warms the surrounding air. By the convection process air rises in an updraft causing thunderstorm.
Mature stage-: warm air rises and reaches to the already present warmer air. Now storm takes anvil shaped characteristics by the spreading out of the air forming cumulonimbus incus. Water droplets condense to ice crystals. When these crystals fall they start melting but if the updraft is very strong they do not completely melt and reaches as hail. With the updraft downdraft of rain is also present. The presence of downdraft and updraft simultaneously is the mature stage. When turbulence created in the storm then it can cause heavy lightening, strong winds and tornadoes too.
Supercell-: if the speed of air or direction or both continuously keep on changing separating downdraft and updraft the storm can change to supercell and it holds on to its mature stage for several hours. Sometimes the atmospheric conditions are favorable for the thunderstorm to be in mature stage for a while even in little wind shear.
Dissipating stage-: in this downdraft dominates. Storm can easily reach to dissipating stage if its supercellular stage does not occur. Here the downdraft makes its way through the thunderstorm while striking on ground. Now this cool air becomes obstacle for the inflow of thunderstorm. So gradually updraft diminishes the resulting thunderstorm to die.