Why does cold mountain air become warm when it descends into a valley?
Because, it is adiabatically compressed. The Earth's atmosphere is transparent to solar radiation. It passes through the atmosphere and is absorbed by the ground. The ground re-emits it as heat. Some of that heat is trapped by the atmosphere, which acts like a blanket, but otherwise, within the first 10 km, the farther you get from the ground, the colder it gets. If we go even higher it actually starts warming up again due to high concentration of ozone, which emits heat. If we go even higher, it starts decreasing again, and if you go even higher, it increases again.