I know it vaguely amounts to "some place where the gradient of temperature is inverted". But why are inversion layers so important in meteorology ? Why do they matter ? Air is colder here ... Big deal ! ?
An inversion occurs when the air is warmer than the ground. It is called an inversion because it is the opposite of what occurs during the day. During the day, the ground is heated by the sun and the air near the ground rises.
However, during clear and calm nights, the ground will cool faster than the air. This means that at a certain time, the air will be warmer than the ground. With nothing to move pollutants upward, the air just stagnates. People will still keep pumping pollutants out, with the pollution just accumulating. During the day, however, the pollutants are lifted upwards, and do not stagnate.
For those mathematically affluent, the equation for a concentration of a pollutant can be written as $$\frac{\partial c}{\partial t}=-\vec{v}\cdot\nabla_h c-w\frac{\partial c}{\partial z}+\nabla \cdot (K\nabla c) +S_c(t)+C$$
where $c$ is the concentration of the pollutant, $\vec{v}$ is the wind vector, $w$ is the vertical velocity, $K$ is the Fick's law constant, and $C$ is the chemistry term.
If we consider the following assumptions which are common, regardless of an inversion:
During an inversion, because air at the surface is not going up, there is no air going down. This means $w\approx0$. With no vertical velocity, the air near the ground is slowed by the drag the ground has on the air, making $\vec{v}\approx0$. This boils the equation down to $$\frac{\partial c}{\partial t}=S_c$$. Since $S_c \ge0$, $c$ will just keep increasing.
A good example of a dangerous inversion is the Donora event.
But additionally, inversions also are formed when cold air is blown in near ground level, such as during a cold front. But, the peak of such a cold airmass generally associates with high pressure.
And high pressure cores have calmer horizontal winds.
So when such a cold high pressure gets stuck and parks in place, it can lead to prolonged inversions.
Additionally, inversions tend to be self-perpetuating over time. Fog and smoke form, block out the sun, and those just keep the low-level air layer cold.
It can be very difficult to forecast just how much the inversion will break down during the day, leading to greatly busted forecasts. I remember many times in Oklahoma where they thought it would warm up a fairly typical 20 degrees (F) during the day, but the fog never fully eroded, and we only ended up rising a few degrees. We also ended up having solid weeks or more of foggy conditions.
Furthermore, the geography in some regions favors inversion formation, and so inversion forecasting inversions can be particularly important for such locations. Sometimes these features can even enhance storm systems or alter their tracks. For more on these targets, look into cold air damming and marine layers.
Inversion conditions also can prove to be quite important flies-in-the-ointment for severe storm forecasting as well. Severe thunderstorms often rely quite a lot on afternoon heating to fuel the rapid updrafts of the storms. Sometimes the same mugginess that highlights that conditions are ripe for storms can wind up being so rich that fog and low-level clouds develop overnight, and prove resilient well into the day. The result can be that the forecast severe weather outbreaks ends up coming to nothing. Or instead, if a fog inversion were expected but doesn't materialize it can often generate unexpected or incorrectly timed severe weather outbreaks. So severe weather forecasters have significant interest in understanding inversions as well.
So... inversions form most every day, but typically as the day evolves, the atmospheric heating engine kicks in, and wind resets the atmosphere towards being more homogeneous. But when stronger inversions build in, they can snowball into much more depressing, and even very dangerous conditions.