I get what thermal inversion does, but how is it caused? How is the initial warm air created, and how does it get in between a higher and lower blanket of cold air?
Urban areas usually let off a lot of thermal heat, as cars and factories and all of those things that use electricity or gas usually let off a lot of heat. A thermal inversion usually occurs at night, when the sun sets and the city quickly cools off, meaning that a layer of cold air forms under the warm air let off during the day. These layers of air have very different densities and cannot mix well, which is why the layer of cold air is “trapped”. It also traps pollutants.