The greenhouse effect takes place when the sun's rays heat the earth. This heat is absorbed by the surface of the earth and some of it is radiated back into the atmosphere. However, a part of this heat is trapped in the atmosphere by gases such as water vapour, carbon dioxide and methane while the rest escapes into space. these gases let in light from the sun but prevent the heat from escaping like the glass walls of a greenhouse they also act like a mirror and reflect back to the earth some of the trapped heat energy. The more greenhouse gases (GHGs) are present in the atmosphere, the more heat is trapped, subsequently making the earth warmer.