Feedback loop

The CO2 (and other gases) in the atmosphere absorbs some of the infrared radiation from the Earth, while the rest of the infrared radiation goes out into space.

Meanwhile, the energy absorbed by the CO2 molecules causes the molecules to vibrate and the vibrating molecules heat up the atmosphere. Once the CO2 molecules “relax,” they emit electromagnetic radiation in the infrared portion of the spectrum in every direction. Some of this infrared radiation goes back into space and the rest gets absorbed by the Earth.

This causes the particles of the Earth to vibrate, heating up the Earth more. And eventually the particles of the Earth relax, releasing more electromagnetic radiation. CO2 absorbs some of this infrared radiation, which causes the molecules to vibrate. The vibrating molecules heat up the atmosphere, and once they relax, they release infrared radiation. Some of this radiation goes back into space and the rest gets absorbed by the Earth, whose particles vibrate. The Earth heats up more; the particles relax and release electromagnetic radiation. This is known as a feedback loop.