Thunder - Why?

Why does thunder occur? I know it is from lightning but what is actually causing the thunder to happen? What is the lightning doing that is creating thunder?

From some web site:

Sound is generated along the length of the lightning channel as the atmosphere is heated by the electrical discharge to the order of 20,000 degrees C (3 times the temperature of the surface of the sun). This compresses the surrounding clear air producing a shock wave, which then decays to an acoustic wave as it propagates away from the lightning channel.

Although the flash and resulting thunder occur at essentially the same time, light travels at 186,000 miles in a second, almost a million times the speed of sound. Sound travels at the relatively snail pace of one-fifth of a mile in the same time. Thus the flash, if not obscured by clouds, is seen before the thunder is heard. By counting the seconds between the flash and the thunder and dividing by 5, an estimate of the distance to the strike (in miles) can be made.

Lightning heats and expands the air surrounding it forming a compression wave. The return stroke of lightning actually produces a larger wave because it transmits more current. Also, because of the length of the lightning channel, the distant portions arrive later than the nearer ones, hence the duration.

Too late. That’s why he’s a moderator and I’m a hack.

Anger of the gods. Warns unbelievers and miscreants that no one is safe from divine wrath.