If you look at Figure 11.1, you can see what happens during a thermal inversion.
Because of the thermal inversion and the dense air, pollution, particularly smog and particulates, gets trapped near the ground and can’t “escape” to space.
Normally, the temperature would get colder as you go away from the Earth.
Warm air above the polluted cold air traps the particles and creates poor air quality. This often occurs in regions surrounded by mountains.
\