
The heat from the Sun can go straight through glass windows. Once inside, it can become trapped and the inside of a greenhouse will get hotter and hotter.
You can see more detail in this demonstration.
The same sort of thing can happen in the atmospheres of planets. Instead of glass, some special gases, such as carbon dioxide (CO2), prevent the heat from escaping back into space.
These gases are called Greenhouse Gases and the more of them there are in the atmosphere, the stronger the greenhouse effect.
Venus has a very strong greenhouse effect, and is nearly 400 °C hotter than it would otherwise be.
Some scientists think that the pollution on Earth
may be increasing the greenhouse effect here.