For stainless steel the chromium and nickel added to the iron does not rust. So when stainless steel is exposed to oxygen the iron atoms will react with the oxygen in the air and turn to rust leaving the chromium and nickel behind as a shiney layer on top. This stopps the corrosion as the air does not go thrugh this shiney layer into the iron under it.
There is another type of alloy which does not corrode called “corten”. This works slightly differently. Normally when steel rusts the iron oxide on the surface is very fragile, like dust. And this allows the air to get under it to expose new steel to corrode. The process is therefore allowed to continue untill all the steel is corroded away. Some metals such as aluminium actually oxidizes much faster then iron but the oxide layer it forms is very hard and does not allow air though, so it protects the rest of the metal. Corten does the same with steel. The alloy is specifically designed so that the iron oxide alloy that covers it will still be quite strong and not flake off like normal rust. It is therefore protecting the steel underneeth from further corrosion, not as good as stainless steel or aluminium but still quite usable. If you see a structure made out of what looks like rusty old steel but it still looks in good condition it is likely made out of corten and is intended to look like that.
Latest Answers