Stainless steel is primarily an alloy of iron, chromium (10-30%), and nickel. Chromium provides corrosion resistance by forming a passive oxide layer, while nickel enhances strength and corrosion resistance. Carbon is present in small amounts but not a primary alloying element.