NiP alloys are very often used in industry, due to their outstanding performance in corrosion and wear. Alloys with high phosphorus content (≥16 atom % P) are amorphous and show high corrosion resistance in both neutral and acidic solutions irrespective of the presence of chloride ions. The reason for this behavior is attributed to the formation of a “P-enriched surface layer” whose exact nature is still under debate. In this work, an iterative algorithm based on the application of maximum entropy method on nondestructive angle-resolved X-ray photoelectron spectroscopy data has been applied to the investigation of the surface layer grown on Ni18P alloys following mechanical polishing and anodic polarization in sulfate solutions. The results show that the outermost region of the examined alloy has a complex layered structure: (1) an uppermost hydrocarbon contamination layer about 1 nm thick, which includes also adsorbed water; (2) a nickel (poly)phosphate layer of about 1 nm; (3) a highly phosphorus-enriched interface being about 2 nm thick with a marked phosphorus concentration gradient, from 70 to 20 atom %; and (4) bulk alloy with the stoichiometric composition. These findings, together with the chemical state of the different phosphorus compounds, allow us to conclude that the high corrosion and wear resistance of NiP alloys might be ascribed to the presence of a thin, self-repairing nickel (poly)phosphate layer grown on a strongly P-enriched interface. Because the Auger parameter of P at the interface is similar to that of elemental P, it might be also concluded that the interface is enriched in elemental phosphorus.