It protects the alloy against rusting.
Stainless steels contain more than 10% chromium by mass, but almost no carbon. Stainless steels are durable because chromium forms an oxide that protects the steel from rusting. But stainless steel is more brittle than steels that contain more carbon.