Thunder is the sound of the shockwave caused by lightning.
Because sound and light travel at different speeds through the atmosphere, one can time the interval between them to tell roughly how far away the bolt of lighting is. The speed of sound in air is approximately 340 m/s, while the speed of light is so fast that viewing lightning occurs practically instantaneously with the lightning strike itself, so the lightning is approximately one kilometer distant for every 3 second interval (one mile for 5 seconds).
Polytheistic peoples in areas with much thunder, or areas where thunder precedes drought-breaking rain, may postulate a thunder god such as Zeus, Jupiter or Thor.