Charles' law states that the volume of a fixed mass of gas is directly proportional to its Kelvin temperature if the pressure is kept constant. As the temperature of a gas increases, it has more kinetic energy; and if pressure is kept constant, it will take up more space (increase volume). A similar trick was performed by the magician David Copperfield (on a much grander scale of course) .. taking advantage of this simple gas law.
1) Note the balloon expanding as more water vapor/ heated air fill it up.
2) When rapidly cooled, some water condenses (turns back to liquid) and the gas particles have much lower kinetic energy (i.e. lower pressure in this case). The result is that the air inside the flask is at a much lower pressure than our atmospheric pressure.
3) Atmospheric pressure then forces the balloon open within the flask.