Egg proteins build a custard's structure by unfolding under heat and linking into a network; starch granules build a pudding's structure by soaking up water until they swell and lock together. That's the whole distinction. Almost everything a cook notices as different between the two — how forgiving each one is, how it fails, whether the recipe says to boil it or warns you away from boiling it — traces back to which of those two things is actually doing the thickening.
What's setting the liquid
An egg yolk at room temperature is a tangle of folded-up proteins doing nothing in particular. Heat unfolds them. Past about 145°F (63°C) they start finding each other and bonding into a mesh that traps the liquid around it, and by 170–180°F (77–82°C) that mesh has tightened into a full set. Go further and the same bonding keeps going — the mesh squeezes tighter, weeps liquid, and turns grainy. That's curdling, and there's no undoing it once it's happened, though blitzing a lightly curdled custard with a splash of cold cream can chop the clumps small enough that the texture reads smooth again. It's a rescue, not a reversal.
Cornstarch works on a completely different clock. The granules are mostly inert until they hit around 140°F (60°C), where they start absorbing water and swelling. Full gelatinization — the point where they've swollen enough to lock into a gel — doesn't finish until the mixture gets close to a boil, which is why pudding recipes tell you to keep it at a full boil for about a minute rather than pulling it early. Once that gel has formed, it's stable well past the temperature that would wreck a custard. The failure mode for an overcooked pudding isn't curdling at all — it's prolonged stirring and boiling physically shearing the swollen granules apart, thinning a gel that was already set.
The ratio each one runs on
Custard: about one whole egg per cup (8 oz) of milk or cream gets you a set firm enough to hold a knife-clean cut once baked. Swap in two or three yolks in place of that whole egg for a pourable, stirred custard that's never meant to fully set — just pull it off the heat around 170–180°F, before it crosses into curdling.
Pudding: about one tablespoon of cornstarch per cup of milk gets a soft, spoonable set. Push it to a scant two tablespoons per cup for something firm enough to hold its shape, and don't call it done until it's held a full boil for roughly a minute.
Where the two overlap
Plenty of homemade pudding recipes add egg yolks on top of the cornstarch, and that overlap is real, not a technicality. The starch is still what's structurally holding the liquid, but the granules also physically crowd the egg proteins, getting in the way of the bonding that would otherwise cause them to curdle. That's the mechanical reason an egg-and-starch pudding can be brought to a boil that would scramble a plain custard — the starch is running interference for the eggs the whole time.
"Pudding" also carries a much wider meaning outside the US: in Britain it can mean dessert generally, or a whole category of foods, sweet and savory, cooked in a casing — Yorkshire pudding shares nothing with cornstarch or eggs. That's a naming collision, not a cooking one, and it's worth knowing before you go looking for a recipe.