Greenhouse gases trap heat and thus warm the Earth because they prevent a significant portion of infrared radiation from escaping into space.
Greenhouse gases lead to a large amount of infrared radiation staying in the atmosphere. 