Thunder is most often caused by lightening. Lighting is very hot and it rapidly heats the air around it as it strikes. This rapid heat causes the air to expand. The sound of the air expanding is what we call thunder. It is similar to the creation of sound during an explosion. Since light travels faster than sound, we can calculate the distance of a lighting strike by counting the seconds between the lightning and the thunder. We count seconds because thunder isn't generally heard far enough away to count the elapsed time in minutes. In general, each second between the lightning and the thunder is about a mile. There is a precise number, but that is a more difficult calculation.