Due to build up of huge electric charge in the cloud lightning happens.
This expands the air at very high speed causing the sound of thunder."The sudden increase in pressure and temperature from lightning produces rapid expansion of the air surrounding and within a bolt of lightning. In turn, this expansion of air creates a sonic shock wave, similar to a sonic boom, which produces the sound of thunder, often referred to as a clap, crack, peal of thunder, or boom." fro m wikipedia.