I like Gef's answer ;)
But yes, it's all down to pressure with these kinds of things. The air in the bottle is pushing down on the water, try to get it to escape, but the pressure of the air outside the bottle is also pushing on this water, through the top.
Pressure = Force / Area. Thus the smaller the area, the greater the pressure (for constant force). This is why the area of the gap in the top where the water escapes has to be small. If it was big.. i.e. a pint glass, then it'll just fall out as the pressure of the air isn't enough to keep the stuff in. But i'm sure you knew that!