The electrochemical CO2 reduction reaction (CO2RR) that transforms CO2 to CO has attracted great interest. Transition metal nanoparticles encapsulated in nitrogen-doped carbon ([email protected]) catalysts exhibit outstanding catalytic performance. However, the role of metal and N species in [email protected] catalysts remains unclear. In this work, [email protected], C[email protected], [email protected], and [email protected] catalysts were achieved and employed in CO2RR. The [email protected] catalyst exhibits an industry level current density of 220 mA cm−2 and a high Faradaic efficiency of 98% for CO production at − 0.87 V vs. RHE for 100 h. In addition, the N species, especially the pyrrolic-N in the shell of [email protected] material provide active sites for adsorbing and activating CO2 molecules, and metal nanoparticles improve the electronic structure of N species, thereby decreasing their ability for radical attack (*COOH, *CO, and *H). Consequently, this work can guide the design of [email protected] catalyst for CO2RR to CO.