The sun’s rays penetrating the atmosphere are largely absorbed by the earth’s surface, turning into thermal energy, and some are sent back into space in the form of infrared radiation with longer wavelengths. Some of this radiation is in turn absorbed and reflected by the molecules of the greenhouse gases in the atmosphere, since the greenhouse gases, unlike other elements of the atmosphere, absorb infrared radiation.
In other words, the higher the content of carbon dioxide and other greenhouse gases in the atmosphere, the more sunlight is reflected by the atmosphere and absorbed by the earth, leading to a rise in average temperatures at the Earth’s surface.