Why does this work?
Heat from the candle will get transferred into the balloon rubber and whatever is filling the balloon... this is known as heat conduction. When you heat a gas or liquid it expands and rises up. Why is this so? The density of the gas or liquid decreases as it heats up.
The water within the balloon absorbs the heat from the candle and rises, drawing the heat away from the balloon rubber so that the balloon survives the flame. Once the hot water rises away from the flame to the top of the balloon it then cools down, dropping back towards the flame to then get hot and rise again. This process is continual convection current, whereby the warming water rises and the cooling water falls. This process helps to keep the balloon from popping by constantly drawing heat away.
You see convection currents within lava lamps. In lava lamps the coloured oil is heated by a light and then rises, to eventually cool and fall back to where it started.... only to repeat the process again. Convection currents are incredibly important in our weather systems and ocean currents.
The air-filled balloon pops because the air quickly expands and does does not absorb enough of the heat energy from the rubber to protect the balloon. This allows the rubber of the balloon to stretch very quickly, tearing the balloon.