As the water is heated it changes forms from liquid to gas. The sugar is left behind as a solid, providing us with evidence that it was in there the whole time.