Sunshine and the heater bring heat in; the glass, the air through the vents and gaps, the soil and evaporating water take it away. What is left over warms the house or, when it's negative, cools it.
Through the glass and the vents the house only loses heat to the outside when it is warmer than the outside (only on a clear night does radiation to the cold sky take it lower), so a run of shut vents on a sunny day piles heat up until the glass alone can carry it away.
SCENE
WIND
What keeps a glasshouse warm
Sunshine passes through glass and warms the soil, the plants and the air. Outside, that warm air would rise and blow away and be replaced by cooler air. Under glass it can't: the warm air stays put. That is the main reason a glasshouse is warm.
Glass also stops infrared, the heat that warm things give off, so the floor's radiation is caught by the glass rather than escaping to the sky. That helps, but less. The orange bar shows this house with a glazing that let infrared straight through: it still gets far warmer than outside, as long as the vents are shut. Open the vents and most of the extra warmth goes.
Wood's boxes, 1909
The American physicist Robert W. Wood put two small boxes, blackened inside, in the sun, one under a glass plate and one under a plate of rock salt, which lets infrared through. Both got hot, and he reported that they ended within about a degree of each other. He concluded that a greenhouse warms mainly because its air is shut in. His note was short and gave few details, and people have argued about it since: careful repeats find that the infrared part is real but smaller than the shut-in-air part, for a box or a glasshouse. This page's own sums say the same.
Polytunnels and the sky
Plain polythene lets much more infrared through than glass, so on a clear night a polytunnel can end up colder than the air outside: try CLEAR NIGHT. Growers buy "thermic" film made to stop it.
The Earth is different
The atmosphere has no lid: warm air rises freely. It warms the Earth's surface another way, by absorbing infrared and sending some back down. The "greenhouse effect" took its name from glasshouses, but it works by the infrared route. Wood's boxes tell us how glasshouses work; they say nothing against the atmosphere's greenhouse effect.