If it wasn’t for the greenhouse effect, the Earth would be as cold and dead as the far side of the moon.
The pulses of energy released by the sun’s gravity smashing together hydrogen nuclei and fusing them into helium atoms have to travel the same 150 million kilometres to get to both the Earth and the moon. They arrive at each as the same mix of ultraviolet, infrared and visible light. At both, they heat up rocks, which aren’t so dissimilar, which absorb that energy and emit it as warm, infrared radiation, with luxurious, long wavelengths.
But from the moon, this warmth slips freely back into space. On Earth, it has to navigate an atmosphere.