When sound of thunder travels to the listener from its location, different parts of the same wave have to travel through air of different moisture levels, densities, and molar masses.
This is what I found when I wanted to know about the reason for the rolling sound of thunder (the sound which can be heard many times and for longer times). But as I read it I found it unclear and failed to visualize the overall process when sound travels thereby giving the rolling sound of thunder. I also failed to understand how there will be different moisture levels in the air or what it meant!
I also went through this question but it didn't serve to answer my question or help me to understand the overall process.