Perhaps that flaming ball of thermonuclear fire in the sky, also known as the sun, might have a bit to do with the temperature here on earth.
Bingo we have a winner!
The Sun shines on earth (71% of the surface is water) and heats it up locally causing evaporation. The water vapor (a gas) rises and heats the air which then also rises. When heating is high the level of water in the upper atmosphere is high.
When the Sun cools off a bit, there is less surface heating therefore less evaporation therefore lower upper atmosphere water (as a gas).
Who’d have thought?