Surface structures on radio-frequency (RF) superconductors are crucially important in determining their interaction with the RF field. Here we investigate the surface compositions, structural profiles, and valence distributions of oxides, carbides, and impurities on niobium (Nb) and niobium–tin (Nb3Sn) in situ under different processing conditions. We establish the underlying mechanisms of vacuum baking and nitrogen processing in Nb and demonstrate that carbide formation induced during high-temperature baking, regardless of gas environment, determines subsequent oxide formation upon air exposure or low-temperature baking, leading to modifications of the electron population profile. Our findings support the combined contribution of surface oxides and second-phase formation to the outcome of ultra-high vacuum baking (oxygen processing) and nitrogen processing. Also, we observe that vapor-diffused Nb3Sn contains thick metastable oxides, while electrochemically synthesized Nb3Sn only has a thin oxide layer. Our findings reveal fundamental mechanisms of baking and processing Nb and Nb3Sn surface structures for high-performance superconducting RF and quantum applications.