During a countryside fire on a still winter evening, the smoke forms a horizontal layer after rising vertically to a height of a few metres. Normally the air gets colder the higher you go because of the fall in air pressure. However, an inversion can occur in winter. Warmer air will lie above colder air because the lower layer is cooled as the Earth's surface loses heat by radiating it into space. The two layers will be separated by a sharp boundary.
Smoke rises from stacks because it is warmer than the surrounding air and thus less dense.
But when it hits the inversion layer it stops rising. Though it is warmer and thinner than the air below it, it is not warm and thin enough to make it into the layer above. All it can do is spread along the interface and make the layer visible for interested humans.