Warning.....you asked for it
Bill Tindall, E.Tn.
Corrosion is Black Art. Boggling complicated.
Part 1 Facts: Corrosion can be thought of as an Evil Battery, doing bad. The metal surface will divide into regions of anodes and cathodes. Metal will dissolve (rust) from the anodic regions. (these can switch around as corrosion persists so the whole surface eventually corrodes) Current must flow between these regions to preserve electrical neutrality and for current to flow there must be something to conduct electrons and/or a flow of ions. Soap is a salt and salts are good conductors of electricity. Wet salts are even better and it may be that soap will absorb sufficient water to make it an even better conductor, but it doesn't need to be wet to do its evil deeds. Wax, oil, grease, paint etc are poor conductors so a coating of these things on the surface retards or stops corrosion.
anybody dozed off yet?
Part 2 Speculation Much like a tree oozes sap to protect itself from assault, metals form protective layers of corrosion products that can interfere with the Evil Battery chemistry and slow it down. Some chemicals closely related to the chemicals in soap attack the protective layers or iron and render them less effective. Soap chemicals may behave similarly.
Part 3 Fact : A screw buried in wood presents a special and insidious case of corrosion. The entire buried part of the screw can be the anode and it can corrode like crazy if there is a conductive path from screw to the outside world, as provided by the layer of soap, with or without water.
Part 4: given that we are taking about corrosion there are likely several other soap effects that are also playing a role that I can't think of or don't know about.