By doing this, each time, the porous iron absorbs the oil and eventually the pan becomes non-stick.
There’s no sorrier sight than a neglected cast iron pan. Dry, lackluster and rusty. Poor thing. Here’s how to save it!
Put the pan in a sink with hot soapy water. Scrub away the grime and rust with steel wool. Use some elbow grease, and there’s no sense in getting just some of the rust off, so repeat this as many times as is necessary until all the rust is gone. Don’t worry about scratching the pan… scrub away!
When that step has been accomplished, now it’s time to re-season the pan. Rub the pan with a generous amount of vegetable oil. Put it in a 350 F oven for 2 hours. Remove from oven and let cool. Pour out any remaining oil. Repeat this several times before using the pan for cooking.
After the pan has been properly re-seasoned, and after using it for cooking, scrub under hot water, dry, and apply a thin coat of vegetable oil. Here's my cast iron skillet. See (especially around the edges of the pan) how smooth the cast iron looks? This was a new pan, not one that had been neglected, and is about five years old.