Developing efficient electrocatalysts for the CO2 reduction reaction (CO2RR) is the key and difficult point to alleviate energy and climate issues. The synergistic catalytic effects between metal and nonmetal elements have gained attention for the design of the CO2RR electrocatalysts. The realization of this effect requires a suitable combination of metal and nonmetal elements, as well as the support of suitable substrates. Based on this, the transition-metal-doped β-phosphorus carbide (TM-PC) (TM = 4d and 5d transition metals except Tc) catalysts are designed, and their structures, electronic properties, and CO2RR catalytic performances are studied in depth via first-principle calculations. The strong bonding ability and high reactivity brought by the moderate electronegativity and abundant electrons and orbitals of phosphorus are the key to the excellent catalytic performance of TM-PCs. Coordinating phosphorus atoms improve the catalyst activity in two ways: (1) regulating the electron transfer of the TM active site, and (2) acting as the active site and changing the reaction mechanism. With the participation of coordinating P atoms, the "relay" of active sites reduces the limiting potential values for the reduction from CO2 to CH4 catalyzed by Cr-PC and Mo-PC by 0.27 and 0.23 V, respectively, compared with pathways where only the TM atom is the active site, reaching -0.55 and -0.63 V, respectively. Regarding the coordinating P atom as the second active site, Cr-PC and Mo-PC can catalyze the production of CH3CH2OH at limiting potential values of -0.54 and -0.67 V, respectively. This study demonstrates the dramatic enhancement of catalytic activity caused by suitable nonmetal coordinating atoms such as P and provides a reference for the design of high-performance CO2RR electrocatalysts based on metal-nonmetal coordinating active centers.