The structural and chemical composition of the surface layer (100–140 nm) of niobium radiofrequency cavities operating at cryogenic temperature has enormous impact on their superconducting characteristics. During the last years, cavities treated with a new thermal processing recipe, so-called nitrogen infusion, have demonstrated an increased efficiency and high accelerating gradients. The role and importance of nitrogen gas has been a topic of many debates. In the present work we employ variable-energy synchrotron x-ray photoelectron spectroscopy (XPS), to study the niobium surface subjected to the following treatments: vacuum annealing at 800 °C, nitrogen infusion, and vacuum heat treatment as for the infusion process but without nitrogen supply. Careful analysis of XPS energy-distribution curves revealed a slightly increased thickness of the native oxide Nb2O5 for the infused samples (∼3.8 nm) as compared to the annealed one (∼3.5 nm) which indicates insignificant oxygen incorporation into niobium during 120 °C baking and no effect of nitrogen on the formation of oxides or other niobium phases. By conducting an additional in-situ annealing experiment and analyzing the niobium after the failed infusion process, we conclude that the vacuum furnace hygiene particularly during the high-temperature stage is the prerequisite for success of any treatment recipe.