Air expands as it rises
There is less air pressing down at higher elevations. A rising pocket of air expands into the lower pressure around it and becomes cooler, even when it does not lose heat to nearby air. 1 2
Cooler air can help clouds form
When moist air rises and cools enough, water vapor can condense into tiny droplets. This is one way clouds develop over hills or mountains. 1 2
Temperature can change in other ways too
The usual cooling pattern applies to much of the lower atmosphere, but weather can create exceptions. Sometimes a layer of warmer air sits above cooler air near the ground, a pattern called an inversion. It can keep fog or pollution close to the surface. 1 2