What causes thunderstorms?

Thunderstorms form when an air mass becomes unstable (when air in the lowest layers is very warm and humid, or air in the upper layers is unusually cold, or if both occur). Rising near-surface air in an unstable air mass expands and cools, making it warmer than its environment, which causes it to rise even farther. If enough water vapor is present, some of this vapor condenses into a cloud, releasing heat, which makes the air parcel even warmer, forcing it to rise yet again. Water vapor fuels the storm.