The greenhouse effect occurs when certain gases in the Earth's atmosphere (the air around the Earth) entraps infrared radiation. This makes the planet become warmer, similar to the way it makes a greenhouse become warmer.
The greenhouse effect is caused by greenhouse gases; the most important greenhouse gases in Earth's atmosphere are: water vapor, carbon dioxide, and methane. When there is more greenhouse gas in the air, the air holds more heat. This is why more greenhouse gases cause global warming.