Gases in the atmosphere naturally act as an insulating layer, absorbing
most of the energy that would normally be radiates out into space.
This increases the temperature of Earth. If this didn't happen earth would be cold at night with nothing holding in the temp.
The gases are called greenhouse gases, and increasing amounts of them means the earth gets increasingly warmer.