The natural process by which the Earth's atmosphere traps heat from the Sun, maintaining a habitable temperature.