A Pythagorean cup looks like a normal drinking cup, except that the bowl has a central column in it – giving it a shape like a Bundt pan. The central column of the bowl is positioned directly over the stem of the cup and over the hole at the bottom of the stem. A small open pipe runs from this hole almost to the top of the central column, where there is an open chamber. The chamber is connected by a second pipe to the bottom of the central column, where a hole in the column exposes the pipe to (the contents of) the bowl of the cup.
When the cup is filled, liquid rises through the second pipe up to the chamber at the top of the central column, following Pascal’s principle of communicating vessels. As long as the level of the liquid does not rise beyond the level of the chamber, the cup functions as normal. If the level rises further, however, the liquid spills through the chamber into the first pipe and out the bottom. Gravity then creates a siphon through the central column, causing the entire contents of the cup to be emptied through the hole at the bottom of the stem. Some modern toilets operate on the same principle: when the water level in the bowl rises high enough, a siphon is created, flushing the toilet.
So how does it work?
There is a tube (or other channel) that runs from an opening near the bottom of cup upwards to a certain height, and then down through the base of the glass. Provided the water level does not go above the upper part of the loop, it cannot escape out through the base.
But if the cup is filled above the loop, it spills over on the inside and drains out of the bottom!
The surprising thing here, and what makes this a reasonable physics demonstration as well as a cute trick, is that the cup drains completely once the process is started. The unlucky drinker has created a siphon in their glass, the same process by which one can use a hose to drain a fuel tank, or (ick) a septic tank.
It is a little more tricky to explain how a siphon works! In short, the weight of the water falling through the lower portion of the tube at the base of the glass reduces the pressure at the upper portion of the tube, allowing water to be “pushed” into the tube by the weight of the water remaining in the glass. This explanation has been surprisingly controversial, however, as it has been demonstrated that some siphons can work in a vacuum, suggesting that intermolecular forces can play a significant role in “dragging” the liquid through the tube. As far as I know, however, the atmospheric pressure explanation sufficiently matches the observational evidence under most circumstances.