[Physics] A filled bottle with a hole — how does atmospheric pressure keep water from flowing out

fluid-staticspressurevolume

I understand that when you make a hole on a bottle filled with water and put the cap on tight the water will not flow out due to the atmospheric pressure acting on the hole.

My confusion is that, lets say there's some space remaining on top of the water, when you close the tap, there's still air inside it, so there is pressure from the atmosphere acting on the surface of water inside the bottle. And the hole is at a height $h$ below the surface of the water, so there's also pressure from the depth $h$ of water due to gravity.

So how does the atmospheric pressure on the hole equal the atmospheric pressure on top of the surface and the water pressure due to depth $h$?

Best Answer

As you close the cap, you seal off the top of the bottle from the atmosphere. At first, some water will flow out, which will decrease the pressure of the air that is still in the bottle. Once the pressure difference between the air in the tip of the bottle and the outside atmosphere is large enough to counteract the force exerted by gravity on the water, it will stop flowing out and at that point is held in by the pressure difference from the air inside the bottle to the atmosphere outside.