You cover the pan with a fat, overheat it, and the fat polymerizes : https://www.seriouseats.com/how-to-season-cast-iron-pans-ski...
Heck, I've done it on aluminum pans and eggs are fine, just like old-school breakfast spots and their griddles.