What You Did
You created a difference in air pressure between the inside of the cup and outside the cup.
When you remove your hand from the cardboard, both the water and the cardboard should stay put.
If your cup is not completely full of water, the water will fall out of the cup.If your cardboard is too heavy, the surface tension of the water may not be strong enough to hold it to the glass.If your cardboard doesn’t completely cover the top of the glass, the water and cardboard will both fall.
Try different types and thicknesses of cardboard Try adding a little soap, a surfectant (surface tension reducer) to the water
air pressure, surface tension