Greenhouse gases absorb lower frequency radiation, so they absorb a large amount of the radiation emitted by the earth (less so much by the sun as frequency tends to be too high). The greenhouse gases then re-emit the radiation in all directions, including back to Earth. The more greenhouse gases in the atmosphere, the more this happens