A rubber sucker as shown above, when pressed on a surface sticks to it, because:
A partial vacuum is created on pressing the rubber sucker.
Atmospheric pressure acts on it externally.
The principle on which Rubber suckers work is: When the sucker is pressed against the surface, it squeezes out the air inside the sucker. The atmospheric pressure on the outside of the sucker holds its rim firmly against the smooth surface.
A rubber sucker, when pressed on a surface creates a partial vacuum as shown in the figure.
Once all the air is pushed out and a vacuum is created, the pressure exerted by the air outside is way more than the pressure inside, and hence it sticks to it.