Oxygen evolution reaction (OER) plays a crucial role in various energy conversion devices such as water electrolyzers and metal–air batteries. Precious metal catalysts such as Ir, Ru and their oxides are usually used for enhancing reaction kinetics but are limited by their scarcity. The challenges associated with alternative non–precious metal catalysts such as transition metal oxides and (oxy)hydroxides are their low electronic conductivity and durability. The carbon encapsulating transition metal nanoparticles are expected to address these challenges. However, the relationship between precursor compositions and catalyst properties, and the intrinsic functions of each component has been rarely studied. Herein, we report a highly durable (no degradation after 20,000 cycles) and highly active (360mV overpotential at 10mAcm–2 GEO) OER catalyst derived from bimetallic metal–organic frameworks (MOFs) precursors. This catalyst consists of NiFe nanoparticles encapsulated by nitrogen–doped graphitized carbon shells. The electron–donation/deviation from Fe and tuned lattice and electronic structures of metal cores by Ni are revealed to be primary contributors to the enhanced OER activity, whereas N concentration contributes negligibly. We further demonstrated that the structure and morphology of encapsulating carbon shells, which are the key factors influencing the durability, are facilely controlled by the chemical state of precursors.