Why the sound lags
A lightning stroke heats its channel of air almost instantly to tens of thousands of degrees. The superheated air expands faster than the speed of sound, creating a shock wave that relaxes into the rolling pressure wave we hear as thunder.
Light reaches you essentially instantly, but sound dawdles at about 343 metres per second — roughly three seconds per kilometre. Count the seconds between flash and bang, divide by three, and you have the storm's distance in kilometres. If the gap shrinks, the storm is coming closer.
Why thunder rolls and rumbles
A lightning channel is kilometres long, so sound from its far ends arrives later than sound from the near parts, stretching a single crack into a long roll. Reflections from clouds, hills and buildings smear it further. Close strikes sound like a sharp crack or tear; distant ones arrive as low rumble, because air absorbs the high frequencies first.
Thunder can usually be heard up to about 15–25 kilometres away. If you can hear it at all, the storm is close enough to respect: lightning can strike well outside the rain area.

