What gives superglue its super powers? Cyanoacrylate.
Cyanoacrylate is a sticky substance called a resin. When its molecules come into contact with water molecules on skin or any other surface they begin to form chains that lash around and create a really strong, durable plastic weave. Chains of molecules keep getting added into the mesh until the structure is so thick and hard that the chains can‘t move anymore. Anything stuck to the mesh is usually stuck for good.
In addition to fixing coffee cups and larger things, a special type of superglue can be used to close wounds instead of stitches.
And if you accidentally get stuck to whatever you‘re superglueing, nail polish remover is good at dissolving the glue.
"Why is Superglue So Strong?" (HowStuffWorks)