In fact, they are necessary for life on Earth. They absorb sunlight reflected from Earth, preventing it from escaping into space. By trapping heat in the atmosphere, they keep Earth warm enough for people to live. This is called the greenhouse effect.