Typically as elevation increases on Earth, the temperature of the air decreases. An inversion layer is a region or layer of the atmosphere in which the temperature stops decreasing with elevation and instead becomes warmer. These are a significant factor in the formation of smog, a type of pollution often seen over densely populated cities such as Los Angeles and Mexico City.
It is fairly common knowledge that hot air rises, so normally smog that is hotter than air would rise high into the atmosphere, where it could disperse throughout the environment. However when smog encounters a hotter inversion layer it cannot rise anymore, resulting in it being "trapped". This causes the smog to remain suspended fairly low over a city and it cannot be dispersed as easily, resulting in the population feeling the effects of its pollutants. Cities located in a valley and surrounded by mountains are especially susceptible to inversion layers, and when they are located near the ocean it effectively amplifies the inversion.