Nothing sticks to this pan. So how is the coating stuck on? An egg slides right off it, yet that black layer stays on. On a good pan, it is thinner than a hair.
The answers start with an accident. In April 1938, a chemist at DuPont, Roy Plunkett, reached for a cylinder of gas. It was not empty, but when his helper, Jack Rebok, opened the valve, nothing came out. Years later, Plunkett remembered Rebok saying: "Well, nothing's coming out. I don't know what the heck is wrong." When they took the valve off, a white powder fell out. It would not dissolve in anything in their lab, because the gas had joined itself into long chains. That powder was later named Teflon. So no, it was not made for pans. The pan came in France, in 1954.
Is it glued?

So what holds the coating on? Glue? Rough metal that it grips? Or is it just pressed on hard?
What holds the coating on: glue, rough metal that it grips, or pressure alone? Pick one before you read on.
You have probably heard that the coating is glued on. But glue is just one more thing trying to stick to the coating. It grabs the metal fine, but it cannot grab the coating, so the coating lifts right off. A DuPont patent from 1992 puts it bluntly: "almost by definition there will be difficulties in making it adhere well." The same thing that frees your egg frees the glue.
Cut the pan in half, and the layers are simple. At the base is the metal, then a thin primer, and on top is the top coat, the Teflon your egg touches. A micron is a thousandth of a millimetre, and a hair is about seventy microns. On a good pan, all of this is about thirty-five microns.
Why nothing sticks

Sticking is a pull. Molecules in your egg tug on molecules in the pan. Bare metal pulls hard, so the egg grabs on and burns on. Teflon is a long chain of carbon atoms, and each carbon carries two fluorine atoms, packed so tightly they wrap the chain like a sleeve. Fluorine pulls electrons toward itself harder than any other element. So none are left loose on the outside, and there is almost nothing for an egg to tug on.
Water shows the difference. Water pulls on itself roughly four times more strongly than it is drawn to Teflon, so a drop pulls itself up into a bead. Its edge meets the surface at about 110 degrees. On steel, the angle is nearer 80. Yet Teflon is a dry solid, and its maker's handbook is plain: "Almost nothing sticks to them. Almost nothing. Remember that almost."
Sticking is a pull, and Teflon pulls on almost nothing, so food has nothing to grab.
How it holds on

If almost nothing sticks to Teflon, how do you attach it? Step one: blast the metal with grit, leaving peaks and pits about five to six and a half microns deep. Step two: spray on the primer, a tough binder that fills the pits and grips the metal, with grains of Teflon stirred in. Step three: spray the top coats on while it is still wet.
Step four, in modern pans, is one bake for the lot: about 427 degrees Celsius, for about five minutes. Teflon melts at 327 degrees, so every grain melts, and the layers flow into one another.
And here is that "almost" again. Melted Teflon does not stick to Teflon. It merges into one piece. The only join left is binder to metal, and that is what the pits are for.
Melted Teflon does not stick to Teflon. It merges into one piece, so there is no seam inside the coating.
So if you guessed rough metal, you were partly right. The first pans, in 1954, etched the metal with acid and baked it at 370 degrees for ten minutes.
What ruins it
Except there is a catch.
Heat built this coating, and heat can undo it.
For everyday cooking, the limit is about 260 degrees Celsius, or 500 Fahrenheit. Above that, the coating slowly breaks down and can lose some of its non-stick. Near 350 degrees, it breaks down much faster. The factory bake is hotter, but it lasts only about five minutes, once.

An empty pan can reach that limit fast. In tests, an empty pan on a high burner passed the line in about two to five minutes, depending on the pan and the stove. So pan makers say: no very high heat, and never leave an empty pan on a burner. Overheated, the coating gives off fumes. In people, they can cause a rare, flu-like fever that passes in about a day. Pet birds are far more sensitive, and the fumes can kill them.
Scratches are the other way pans wear out. A deep one cuts down through the thirty-five microns to bare metal. And bare metal pulls hard, so food grabs on, right there.
Try it
Want to see it at home? Take two cold, clean pans, one non-stick and one steel, and no heat at all.
Put one small drop of water on each pan, about four millimetres across. Photograph it from the side with a ruler beside it.
On the non-stick pan, the drop should stand about two and a half millimetres tall and three and a half millimetres wide, about seven tenths as tall as it is wide. On steel, it is nearer four tenths. Steel holds on to water nearly twice as hard.
Here is a question about one way to save money. Suppose the factory skips the grit blasting. Do eggs still stick, and does the coating last? Eggs still slide, because the same Teflon is on top. But the primer has no pits to lock into, so the coating peels off much sooner.
In one breath
Teflon pulls on almost nothing, so food has nothing to grab, and grit, a gripping primer and one hot bake hold the layers on. Keep the heat under 260 degrees and away from deep scratches, because heat and scratches are what undo it.