Platinum-rare earth metal (Pt-RE) nanoalloys are among the most active electrocatalysts for the oxygen reduction reaction and are predicted to exhibit long-term stability in proton-exchange membrane fuel cells. We have recently developed a solid-state chemical route for synthesizing this family of alloy materials, which is carried out under seemingly impossible conditions. Here, we report an in-depth understanding of the synthesis mechanism, obtained through systematic investigations of the chemical processes involved at different stages of the synthesis process and the structural evolution of the intermediate products. The formation of Pt-RE nanoalloys is made possible by a series of consecutive chemical and physical processes, including the polymerization processes of the nitrogen-rich precursor, the formation of a porous RE carbodiimide phase, the mobility of the formed metal phases on the carbon support, the reduction of the RE metals driven by the alloying reaction, and so forth. This thorough understanding of the mechanism of the synthesis process lays the foundation for optimizing the synthesis procedures and maneuvering this method to synthesize Pt-RE alloy materials with the desired structures and properties.