To get the liquid to flow out of a medicine ampoule, you have to crack the class at both ends; one only one end is cracked open, the liquid remains inside even if the ampoule is held upside down.
Seems like a simple story of pressure difference: the air pressure is greater than the pressure on the other side of the opening, so the liquid doesn't flow out. Surface tension might also play a role, since the opening is very small.
Assuming there is very little air inside the ampoule, if the area of the opening is $A$ and the mass of the liquid is $m$, the liquid doesn't flow out as long as the pressure from the inside at the level of the opening is smaller than the air pressure: $P_{int}=mg/A<p_{atm}$.
But that can't be right, because experimentally if we increase the size of the opening (increase $A$) past a certain point, the liquid flows out?!??!