This happens because the air pressure exerted on the card from underneath is greater that the weight of the water inside the glass. This is why the card manages to hold up the water not letting it spill out.
The reason this experiment works is because of air pressure. Even though it doesn’t feel like it, the air around us pushes in all directions. The air pushing up from underneath the paper is strong enough to stop of weight of the water from pushing the card down. Because of this air pressure, the card will stay on the glass and the water will not spill out.
it is just a a trial explanation based on qualitative approach. No quantitative dimensions used.
First let us observe the trapped air. Due to change in volume let us assume that a change in pressure is also observed and let the change be from P1 (atmospheric (as the air was open to atmosphere)) to P2. Also assuming Ideal conditions P2<P1 (as PV=constant). Also due to curve of the glass at the neck, in the tumbled position some proportion of water pressure is reduced at the bottom surface.
Using force equation only on the lowest surface of water :
P2 * (Pi * R2^2) +(M2 * g) = P1* (Pi * R1^2) `
also from tumbled glass
R2 >R1 ;
M2 = effective mass of water which is less than actual water as some proportion will be balanced via curve surface of glass.
g = acceleration due to gravity.
Pi = 22/7
For better analysis if one uses Gauge pressure assuming atmospheric pressure is everywhere it becomes further simple as P2 becomes negative (assuming -P2) then
-P2 * (Pi * R2^2) + (M2 * g) =0
=> P2 * (Pi * R2^2) = (M2 * g)
and I think one can find a set of appropriate values from this.