The Earth gets the majority of its energy from the radiation of the sun. The Earth's temperature relies on how much sunlight it absorbs. But not all of that energy stays on Earth. Some of the radiation is reflected back in space. When there is a large amount of greenhouse gases in the atmosphere, the excess radiation is not able to be reflected into space. It instead is trapped in Earth's atmosphere, causing the planet to become warmer.