We live in an ocean of air. When air pushes on things, as it always does, it pushes all over, on every part. The pressure applied to the index card by the water is less than the pressure applied by the air. In other words, the air is pushing up on the card more than the water is pushing down on it. Therefore, the air pressure is holding the card snug against the cup.