That's a really cute demonstration! And, as you say, it can be
quite puzzling. It's a pity your teacher left his students puzzled
about it rather than explaining it fully. I can give you my guess of
what went on in that experiment.
When the water is boiling with the stopper out, liquid water is
being converted to its vapor phase, steam, which fills up the top half
of the flask. If the flask is then taken off of the heater (and then
you have to wait for it to stop boiling otherwise the stopper will be
blown out the top) and stoppered, then water at a temperature just
under the boiling point is in the flask with water vapor above it, all
at approximately 100 degrees Celsius. Rubbing ice around the top of the
flask cools the vapor down and condenses it back into liquid water on
the sides of the flask. Doing this reduces the pressure of the water
vapor over the liquid, creating a partial vacuum.
The vapor pressure of water (that is, the pressure of water vapor
which is in equilibrium with liquid water) depends quite a lot on the
temperature. For water at 100 degrees celsius, it is quite high (about
an atmosphere). If the vapor pressure of the water is higher than the
partial pressure of water vapor over the liquid, then the liquid will
evaporate until it comes into equilibrium. If the vapor pressure is
higher than the total pressure of all the gas over the liquid, then the
water will boil, because the evaporation may spontaneously happen
anywhere in the liquid. You actually need the vapor pressure to be
higher than the pressure in the water at the depth at which the bubbles
form in this case.
You can even get water to boil at room temperature by putting it
into a sealed glass jar and pumping the air out with a vacuum pump.
Water takes 540 calories per gram to evaporate (regardless of the
pressure), and this evaporation cools the liquid water down. In a
demonstration I saw once with water in a vacuum jar, the water boiled
until it froze.
(published on 10/22/2007)