The greenhouse effect is an increase in the temperature of a planet as heat energy from sunlight is trapped by the gaseous atmosphere. Excess carbon dioxide and water vapor increase this global warming effect.
Solar Energy (sunlight) is short-wavelength radiation which easily penetrates the Earth’s atmosphere and warms the Earth; only about one quarter of incoming sunlight is reflected by the atmosphere. The warmed Earth emits long-wavelength radiation (infrared waves or heat energy) back into space; these longer waves are mostly reflected back to Earth by the atmosphere.
The size of the atmosphere in the illustration above is greatly exaggerated in order to show the greenhouse effect. Most of the Earth’s atmosphere is within 10 miles (16 km) of the Earth’s surface).