These gases are referred to as greenhouse gases because they act like the glass covering of a greenhouse, absorbing solar radiation and trapping it inside. Sunlight pentrates the atmosphere and warms the Earth's surface. The Earth then radiates some of this heat back into the atmosphere. Some of this heat escapes into space and some is reflected back to earth as watervapor and greenhouse gases absorb it. As greenhouse gases increase more heat can be trapped near the Earth's surface This build-up of carbon dioxide could cause the planet to heat up.
Trees absorb carbon dioxide to make food during the process of photosynthesis.
Using energy from the sun, green plants break apart carbon dioxide and water molecules and rearrange the loose atoms to form sugar. Trees use sugar as food for growth and energy. Oxygen, which is what humans must inhale to survive, is left over from this process and released into the atmosphere. During the nighttime, this process is reversed. Trees absorb oxygen and emit carbon dioxide.