The iron-chromium alloy and its derivatives are widely used for their remarkable resistance to corrosion, which only occurs in a narrow concentration range around 9 to 13 atomic percent chromium. Although known to be due to chromium enrichment of a few atoms thick layer at the surfaces, the understanding of its complex atomistic origin has been a remaining challenge. We report an investigation of the thermodynamics of such surfaces at the atomic scale by means of Monte Carlo simulations. We use a Hamiltonian which provides a parameterization of previous ab initio results and successfully describes the alloy's unusual thermodynamics. We report a strong enrichment in Cr of the surfaces for low bulk concentrations, with a narrow optimum around 12 atomic percent chromium, beyond which the surface composition decreases drastically. This behavior is explained by a synergy between (i) the complex phase separation in the bulk alloy, (ii) local phase transitions that tune the layers closest to the surface to an iron-rich state and inhibit the bulk phase separation in this region, and (iii) its compensation by a strong and non-linear enrichment in Cr of the next few layers. Implications with respect to the design of prospective nanomaterials are briefly discussed.PACS numbers: 64.75. Nx, 68.35.bd, 61.66.Dk, 64.70.kd, 81.30.Bx The iron-chromium alloy and its derivatives are inexpensive, have satisfactory mechanical properties and above all exhibit a remarkable resistance to corrosion: it is the most widely used class of alloy in the world. Its outstanding corrosion resistance is known for a century 1 to only occur in a narrow range of concentrations, around 10 atomic percent of chromium (at. % Cr) 2 . Their excellent properties make them candidate materials for future fusion nuclear reactors 3,4 , one of the reasons that induced a considerable amount of work on the various aspects of the Fe-Cr alloy both experimentally 5,6 and theoretically 7 .Corrosion resistance of stainless steels is due to the passivation of the material by an inert, chromium rich layer at the interface between the alloy and the environment, i.e. at the surfaces. Passivation is a phenomena inherent to how much Cr is located at the surfaces, which is a non-linear function of the bulk concentration 8 . In austenitic Fe-Cr, which only exists at high temperatures above ≈ 800 C and for less than ≈ 10 at. % Cr, the more chromium in the bulk, the more chromium in the surface and thus the more stainless the alloy. In ferritic Fe-Cr alloys, the picture is more complex. Without additive elements, the Cr content at which the alloy is passivated is narrow, from 9 to 13 at. % Cr, beyond which occurs an increase in the corrosion rate and a strong decrease in mechanical properties.This important property of stainless steels has been extensively studied, but its complex origin at the atomic scale has remained a missing understanding, subject to controversial findings: How chromium causes passivation, i.e. how it interacts and reacts with chemical elements coming fr...