Two key properties govern the atmosphere: air pressure, dictated by gravity, and air temperature, dictated by solar and terrestrial radiation. But all these gases making up the atmosphere don't just stay in one place. As you've certainly observed, air moves. The troposphere, the region of the atmosphere we experience every day, is constantly churning with cycles of vertical and horizontal movement.
Vertical air currents result from changes in temperature and pressure. When air heats up, its molecules move around more rapidly, pushing each other farther apart. The air becomes less dense and rises up through the troposphere toward thinner air. In doing so, however, it moves into colder regions and begins to cool. It eventually cools back to a denser state and sinks back down. This is why the troposphere is thickest in hot, tropic regions and narrowest near the icy poles.
If the air were all the same temperature and the entire atmosphere experienced the exact same heating and cooling, the troposphere would simply swell during the day and compress back down at night. But in reality, different temperatures persist across the globe, mainly because the sun doesn't provide the same heat to every part of the planet, nor does it shine everywhere at once. While it's daytime on one side of the world, it's nighttime on the other. While one city receives sun filtered down vertically through one atmosphere's worth of air, sunlight travels to other areas at a more horizontal trajectory. In these cases, the solar radiation is forced to filter through the equivalent of several atmospheres. This is why the sun appears far less bright at sunset than at high noon.
Temperature also varies from place to place due to the unequal cooling and heating of land and water. Under a blistering, noonday sun, which is hotter: the water in a swimming pool or the cement patio surrounding it? As your feet can attest, the cement is much hotter, which means it's absorbing more heat. This also means it's reflecting more heat back into the air above it. Now imagine this on a scale of oceans and continents. Altitude, geographic location, cloud cover and ocean currents also affect temperatures around the world.
When the air in one area heats up faster than the air in an adjoining area, the pressure differential generates wind. For a simple example of this, look no farther than a large modern city. All that concrete and steel absorbs much more heat than the surrounding countryside. As such, the air in the city grows hotter during the day, becomes less dense and rises in a vertical movement known as an updraft. Meanwhile, the cooler air in the countryside is under far more pressure and begins to flow into the city in the form of surface wind to fill the low-pressure area. Once it enters the hot city, however, it too heats up and begins to rise in an updraft. The air above it cools, but can't settle back into place due to all the rising hot air underneath it. Instead, the cooling air simply pushes out to the sides in the form of upper air wind heading back to the countryside. This wind cycle continues until nightfall sends everything into reverse, as the city cools faster than surrounding areas.
This, however, is just a localized example of the basic principles at work. On the next page, we'll examine how a similar cycle of airflow applies to the entire planet.