All steel is iron based, but stainless steel contains chromium at 10% or more by weight. Steel is susceptible to rust, an active iron oxide film that forms when steel is exposed to air and moisture. This iron oxide film is active and accelerates corrosion by forming more iron oxide.
Stainless steel is rust resistant because of passivity. Passivity is when chromium forms a passive film of chromium oxide to repair the surface layer and prevent further corrosion.