When you pop a balloon, the air that was compressed (squeezed) inside of it rapidly expands, creating a shock wave through the air that sounds like a loud bang. When a bolt of lightning flashes through the sky it heats the surrounding air to temperatures hotter than the surface of the sun! This intense heat causes the air around the lightning flash to expand rapidly and then cool and bounce back (compress) rapidly. This creates a shock wave through the air that we hear as thunder.