water at room temperature is a liquid. This means the molecules have a weak bond and can move around to a limited extent (a gas, steam, has the weakest bond between molecules that move around the most). When you drop the temperature of a liquid, the molecules slow down, eventually to the point where a stronger bond can form; it becomes a solid. In the case of water (because of its unique polar structure where one side of the molecule is positively charged and other is negatively charged), the molecules arrange themselves in a 3-D pattern, called a matrix, that is less dense (takes up more room and will float) than the liquid state. This matrix causes the volume of the water be greater in a solid state than in a liquid state, and may cause the glass to break. Usually, if frozen slowly, the level of water in the glass just rises.