It is called a natural vacuum. a natural vacuum is when there is absolutely nothing no air, or gas, or anything in a certain space and it tries to suck anything it can into it. the empty space above the water in the glass is the vacuum. Another easier way to explain this is the following: there is nothing to take the water that has already poured outs place. So the air is trying to get in and the water is trying to get out and they just keep each other in the same place.
I know this is confusing, but it is hard to explain if you look it up using google or something it might help. Hope this helps.