How does Thunder Occur?

In simple terms, a quick increase in both pressure and temperature will cause the air to expand quickly. The expanding air will cause a sonic shockwave, which causes the loud thundering sound to travel through the air.