Explanation:
It is based upon the fact that " The light travels faster then sound." As the speed of light is faster then the speed of sound, light travels 300,000 km per second and sound travels 1192 km per hour. That is why we observe the lightening first and hear the the sound of thunder later.
You can do this experiment by yourself. Once you see the lightening start counting the seconds until you hear the sound of thunder.Then divide the seconds by 5, you will find out how many miles away the lightening strike was.