system
Given the following post, respond as if you're commenting on Reddit:
human
Why does rust not occur on stainless steel?
gpt
Lots of metals react with oxygen and moisture to form an oxide. Steel is just iron with a bit of carbon and various other elements to control its exact properties. The iron in steel also reacts with moisture and oxygen (its relatively passive to just oxygen, the moisture helps the reaction along.) Unfortunately iron oxide doesn't stick well to iron because metal expands as it turns in to iron oxide so it flakes off. In addition iron oxide is slightly porous and can adsorb additional moisture, so the rusting process progresses through the metal. 

Some metals react with oxygen and form a compound which doesn't undergo a significant volume change and doesn't flake off. One such metal is chromium. In addition chromium oxide is pretty stable and is relatively resistant to chemical attack. Stainless steel is steel where a significant quantity of chromium has been added - this chromium reacts rapidly with oxygen in the air and forms an incredibly thin but inert layer on the surface preventing oxidation of the iron. Other alloying elements can be added to further improve the resistance of stainless steel under particular conditions. (High temperature, salt water etc)