The heating of the troposphere is caused by convection currents. Convection currents are created when the sun warms the air currents at the planet's equator to a greater degree than it does at the planet's poles.
Sunlight heats the regions of the troposphere unevenly. When sunlight enters the atmosphere, part of it is reflected back into space. The rest enters the atmosphere and is absorbed by the Earth's surface. The energy is then released from the ground, where it travels back into the atmosphere. The released energy is absorbed by the carbon dioxide and water molecules in the atmosphere, then released back toward the Earth's surface again. This process prevents the average global temperature from changing drastically year to year.
Convection currents are large-scale patterns of winds that move the heat and moisture created by the sun's energy around the planet. Air rises along the equator and subpolar climatic regions in the Northern and Southern hemispheres. The air sinks in the polar and subtropical regions. The air that moves between the poles and the equator is deflected by the Earth's rotation. This process creates belts of surface winds that move from east to west in tropical and polar regions and winds that move from west to east in middle latitudes.