The surface of most steel dulls and rusts when it is exposed to air and moisture. This chemical reaction with the environment (called corrosion) returns the metal to its mineral state; the steel is transforming back into iron ore. This process is prevented in stainless steels, which retain their metallic luster or shininess. By definition, stainless steels contain at least 10.5% chromium and often contain other elements like molybdenum and nickel. In stainless steels the chromium atoms at the surface react with air and moisture to form a tough, thin layer of protection. Just as a raincoat keeps you from getting wet in a rainstorm, the protective layer insulates the steel from the environment. This layer prevents the chemical reaction that produces rust.
Stainless steel is not a single material, but rather a broad category made up of dozens of different steels. Each stainless steel is unique, varying by the structure of the metal and the amount of alloying elements added to it, but they all increase resistance to rusting and other forms of corrosion. Some stainless steels are very hard and strong, but provide less protection from corrosion. Others are really good protectors, but are softer and weaker materials. A few stainless steels are both strong and very resistant to corrosion, however these are so expensive and are used only when it is absolutely necessary.
Little Lion Experiment:
Here is a simple experiment you can try in your own kitchen (with a parent's supervision). Many kitchens have a stainless steel sink and almost all have stainless steel cutting knives. However these two stainless steels are very different. To illustrate this you can test the stainless steels with a magnet; a refrigerator magnet will do nicely. Try sticking the magnet to the side of knife and to the side of the sink. What happens?
The magnet sticks to knife, but it won't stick to sink. This is because they are made from two very different types of stainless steel. A materials engineer selects the stainless steel with the best combination of strength, protection and affordability for each application. The knife must be hard to stay sharp and still not rust; it is made of ferritic stainless steel. The sink must have good protection because it often gets wet and it must be soft for shaping; it is made of austenitic stainless steel. The magnet is a simple way to tell these two types apart.