Scientific rambling
When we see lightning, we hear thunder because the high temperature generated by lightning quickly heats the surrounding air, causing the air to expand rapidly and create a huge gas pressure wave, which is what we hear as thunder.
Lightning is caused by a huge potential difference between the positive and negative charges in the clouds. When the charge difference is large enough, an electrical discharge occurs between the charges, forming a strong electric current. This current rapidly heats the surrounding air, causing the air temperature to rise to tens of thousands of degrees Celsius instantaneously, forming a high-temperature arc.
The arc of high temperature causes the surrounding air to expand rapidly, forming a gas pressure wave that travels at the speed of sound, forming the thunder we hear. Since light travels much faster than sound, we see lightning before we hear thunder.
The sound intensity of thunder is related to distance, and when lightning occurs at a distance, we may hear less thunder due to the attenuation of sound propagation. And when the thunder and lightning occur in a closer place, the thunder that we may hear will be very loud.
In conclusion, when we see lightning, we hear thunder because the high-temperature arc generated by lightning heats the surrounding air, forming a gas pressure wave, and this pressure wave travels at the speed of sound to form the thunder we hear.