Seasoning is polymerised oil, not a coating you put on
When an oil is heated past its smoke point, its double bonds oxidise and the molecules cross-link into a solid network. That is the same chemistry as paint drying, and it is what makes a pan black and slick. Two consequences follow, and both of them explain failures you have probably had. The first: raw oil is not seasoning. Wiping a pan with oil and putting it away leaves a film that water lifts off and that goes rancid — a layer that protects nothing and smells. The second: thin coats beat thick ones. A thick layer of oil cannot all reach the same temperature, so the outside sets while the inside stays soft, and the whole sheet lifts off in flakes within a month. Three thin layers, each heated until it smokes and left to cool, give a coating that grips.
Rust works the other way round. Iron oxide takes up about twice the volume of the iron it came from, so it cannot sit flat in the place the metal used to be: it rises, becomes a loose, crumbly crust, and holds water against the fresh metal underneath. That is the mechanism behind a pan rusting through. Which means scrubbing the rust off is not a repair, it is a rewind — and unless you seal the bare iron in the same session, the rust you removed has already started again by evening.
Three places, three different answers
Orange powder on the surface, which a fingernail scrapes away to reveal dark film underneath, is the cheap one. Hot water and a stiff brush — no detergent needed, though it does no harm either — then dry it on the flame rather than with a cloth, until the last of the water has flashed off. Then a thin smear of oil, heated until it smokes, and the pan is sealed. The whole job is five minutes, and doing it in the hour after the rust appeared is the difference between a patch and a scab.
Dark pitted speckles, which will not scrape off and feel like dips under your nail, mean the rust has eaten into the metal. Scratch at one with a needle and see whether it bottoms out in a pit. A pit has to be ground back to bright iron — 320 grit, circular strokes, because here you are flattening rather than following a grain — then washed, dried on the flame, and reseasoned from bare metal. It will look pale and ugly for a few uses. It comes back.
Film peeling in flakes means the coating itself has failed, which almost always traces back to water standing in the pan or a night in the sink. It has to come all the way off, not just where it looks loose: hot water and bicarbonate to soften it, a scraper, then 120 grit until the whole interior is bare grey iron. Then three thin coats, each heated to smoking and cooled before the next. Doing it in one thick coat is how people end up back here in three weeks.