Experiments with Candles & Water: Drinking Candle: Simple and Easy Science Experiment kids
Explanation: The drinking candle experiment visually shows us that atmospheric pressure exists, and air exerts pressure from a high-pressure area to a low-pressure area.
The candle flame heats the air in the glass, and this hot air starts expanding. A fraction of expanding air also escapes out from beneath the glass (you can see some bubbles oozing out). Eventually, when the flame goes off, the air inside the glass cools down and the cooler air starts contracting. The cooling of the air inside the glass creates a relatively low-pressure area inside the glass than the area outside the glass.
So, this low-pressure area is responsible for pulling in water inside the glass. This happens as air exerts pressure from a high-pressure area to a low-pressure area.
Source: https://www.zlifeeducation.com/blog/drinking-candle/