Weather is caused by the movement or transfer of heat energy. Energy is transferred wherever there is a temperature difference between two objects. There are three main ways energy can be transferred: radiation, conduction and convection. In the atmosphere, the main way energy is moved from hotter to colder regions is by convection. Convection involves the bodily movement of the more energetic molecules in air. Convection takes place both vertically and horizontally. Air convects or rises vertically when air near the ground becomes warmer, and therefore less dense, than air above it. This is common in the troposphere where atmospheric temperature usually falls with increasing altitude. Air convects horizontally when surface pressure differences, which develop because of temperature contrasts, generate wind. Horizontal convection is sometimes called advection.
Regions nearer the equator receive much more energy than regions nearer the poles, and are consequently much warmer. These latitudinal differences in surface temperature create global-scale flows of energy within the atmosphere, giving rise to the major weather patterns of the world. At smaller scales, common weather systems like frontal depressions are formed when warm air masses rise above colder ones, generating clouds and rain. At the smallest scales, individual rain-bearing cumulonimbus thunderclouds, and even the smaller rain-free cumulus clouds, are phenomena of heat transfers via convection.
The troposphere is capped by the tropopause, a region of stable temperature about 12 km above the Earth's surface. Air temperature then begins to rise in the stratosphere. Such a temperature increase prevents much air convection beyond the tropopause, and consequently most weather phenomena are confined to the troposphere.