When an air parcel rises, it will start to expand as it encounters less atmospheric pressure. This phenomenon is observable in everyday life. For example, if you take a bag of potato chips (which is basically an air parcel with some junk food inside) to a higher elevation, the air inside the bag will expand as the surrounding air pressure drops. The clip below shows a SunChips bag expanding as it’s driven up to Pikes Peak in Colorado (where air pressure is ~50% lower than you’d find sea level).

A bag of chips expands as it encounters lower atmospheric pressure. (Credit: YouTube user @alittletoaster)

This same type of expansion is observable, even more dramatically, in a sturdy balloon. The time-lapse clip below shows a rising weather balloon, which approximates the behavior of an air parcel, expanding as the atmospheric pressure decreases during a ~90,000-foot ascent. The balloon expands to more than 100 times its original volume, until it finally says “no more” and explodes!

A weather balloon expanding and exploding at 95,000 feet (Courtesy of Patrick Cullis)

Rapid expansion of an air parcel (as it encounters lower atmospheric pressure) will cause it to cool significantly — generally a few degrees or more per 1,000 feet. The weather balloon above, for example, cooled to way below freezing temperature as it expanded.

This cooling occurs because, at the molecular level, an air parcel uses up some of its internal energy as it expands. In a sense, energy is required for the air parcel to “push out” into the environment. A reduction in internal energy corresponds to a reduction in heat energy. Therefore, when a gas’s internal energy decreases, so does its temperature. (If you are interested in the detailed thermodynamic behavior of gases and the nature of so-called “adiabatic expansion,” you can learn more here.)

A good household example of expansion-related cooling is letting air out of a bike tire. A guy named Ryan demonstrates this below on YouTube. Ryan lets air rush out of his bike tire; the air naturally expands as it moves from being under high pressure (inside the tire) to lower pressure (outside the tire). As expected, the air cools a lot in the process, as shown by the Celsius temperature gauge.

Air rushing out of a bike tire expands and cools (Credit: YouTube user Ryan Bettens)

On the flip side, when an air parcel encounters greater atmospheric pressure, it will compress and warm. Ryan from above posted another video showing how the temperature of air increases when it is compressed to inflate a bike tire.

Similarly, an air parcel out in the wild gets compressed and warms when it moves from higher elevation to lower elevation. The increase in atmospheric pressure squishes the parcel, thereby transferring internal energy to it and increasing its temperature. That’s a major reason why Death Valley — the lowest point in North America — is so hot: any air parcel that descends to that low of an elevation undergoes intense compression and warming in the process.

A second instructive example: why is it colder in the mountains?

Mountains are colder than lower elevations for the same basic reason that it’s cold outside a plane: air is always on the move, and any air that moves upward in the atmosphere will expand and cool.

One major difference between planes and mountains is that when you’re on a mountain, you’re standing on land — rather than flying in the sky. Land can be quite effective at absorbing the sun’s energy and transferring warmth to nearby air. This type of warming doesn’t happen in the free atmosphere where a plane flies, since air itself does not readily absorb sunlight.

In this way, sunlight absorbed by the surface of a mountain or a high plateau will act to increase local temperatures. The bigger a mountain’s surface area, the larger the heating effect. However, there are reasons why mountains are still generally colder than land at lower elevations.

First, air is always on the move: a given mountain range — even if heated significantly by the sun — will encounter cold air blowing in from other sky-high locations. Much of this air will be quite chilly because it has not been warmed by a sun-baked surface. Indeed, the earth has a relatively small amount of high-elevation surface, and thus has limited ability to heat high-elevation air on a large scale.

Second, some air arriving in the mountains will have risen up from lower elevations, expanded, and cooled due to the decline in atmospheric pressure.