The uneven heating of Earth's surface by the sun is also a driving force behind global patterns of winds and precipitation . When air is warmed it can absorb more moisture, and it also tends to rise. Higher in the atmosphere the air cools again, forming clouds that produce rainfall.