The sun's radiation is centered around the visible spectrum. That might seem a bit too convenient, but recall that the sun was here before our eyes. Anyway, the Earth's atmosphere is almost completely transparent to the visible spectrum so almost all of it strikes the earth, water or clouds. Eventually,
all the incident light is either reflected back to space or absorbed. Upward, of course, is the escape to space. Getting absorbed transfers the light's energy to whatever surface absorbed it. That will increase its temperature.
Now here is where we get to the Stefan-Boltzmann equation that Reiny Daze throws around as if he has it tattooed on his forehead. It concerns the thermal radiation that all matter above absolute zero (which is to say, ALL matter). The spectrum of that radiation graphs out like a lopsided lump. It looks something like these:
View attachment 855771
The SB equation will provide us with the spectrum of an object based on its temperature and an emissivity constant for each sort of material. For a "room temperature" object, as you can see in the diagram above, the bulk of thermal radiation is in the infrared (IR) band.. So the energy that came in from the sun in the visible band, leaves via the infrared band.
Now I would not blame you if this gave you the thought that everything will eventually run out of energy and cool itself down to absolute zero. If you were looking at an object that was surrounded by absolutely nothing or by a shell of material magically at absolute zero, that is precisely what WOULD happen. But, here on the Earth, that's just not the case. Remember that EVERYTHING is radiating thermal energy. So, here on the Earth, we are constantly surrounded by stuff: walls, buildings, people, cars, trees, posters to see Ted Cruz's vacation slides, Ted Cruz's slide projector, that is all much warmer than absolute zero and is therefore radiating away. So the temperature of any object, like that vase your wife put on your PC desk, is determined by the balance - the algebraic sum - of the energy it is receiving and the energy it is sending away. That is why everything doesn't just get colder and colder and colder.
Unlike the incredible transparency that air has to visible light, several components in our air absorb portions of the IR spectrum like a sponge: water vapor, carbon dioxide, methane, nitrous oxide and ozone. With the exception of water vapor, these are all present only in small quantities but they are very effective. In the preindustrial era, CO2 was present in our air at 280 parts per million (ppm or 0.028%). It is now at 420 ppm, but even at just 300 ppm, it has been demonstrated in laboratory experiments to absorb 100% of IR light in a distance of less than 10 meters.
So, portions of the IR light that are emitted by the ground, the water, the trees and plants, the buildings, the streets or the top of your head gets absorbed by these gases in the atmosphere. Just like the surface, that energy absorption causes those gases to warm up. Now that warmth, that thermal energy, has two places it can go. It can either radiate away as IR once again or it can get transferred through a physical collision with another molecule of gas or liquid or solid (air, ocean, earth). Among all the zillions of molecules in our atmosphere, both take place.
When we step back now and have a look at what's happening we'll see that thermal energy still has only two places to go. It can either stay somewhere on the Earth, in our air, our land or our water, or it can escape to outer space and Cosmic Splitsville. But, you know, that was always the case. The Earth and the solar energy pouring on to it is like a bucket left under a leaky faucet. The bucket will fill till it starts overflowing and then the amount that comes in from the faucet and the amount that spills over the sides will be perfectly equal. The bucket will maintain that level of fullness indefinitely. The same is true of the Earth under equilibrium conditions. The amount of energy coming in from the sun and the amount being radiated away by the warm Earth would be exactly equal and the planet's temperature - AS A WHOLE - would be constant. But what happens when something changes?