Electrocatalysts based on metal-organic frameworks (MOFs) attracted significant attention for water splitting, while the transition between MOFs and metal oxyhydroxide poses a great challenge in identifying authentic active sites and long-term stability. Herein, we employ on-purpose defect engineering to create high-density atomic level defects on two-dimensional Fe-MOFs. The coordination number of Fe changes from 6 to 4.46, and over 28% of unsaturated Fe sites are formed in the optimized Fe-MOF. In situ characterizations of the most optimized Fe-MOF0.3 electrocatalyst during the oxygen evolution reaction (OER) process using Fourier transform infrared and Raman spectroscopy have revealed that some Fe unsaturated sites become oxidized with a concomitant dissociation of water molecules, causing generation of the crucial *OH intermediates and Fe oxyhydroxide. Moreover, the presence of Fe oxyhydroxide is compatible with the Volmer and Heyrovsky steps during the hydrogen evolution reaction (HER) process, which lower its energy barrier and accelerate the kinetics. As a result, the optimized Fe-MOF electrodes delivered remarkable OER (259 mV at 10 mA cm-2) and HER (36 mV at 10 mA cm-2) performance. Our study offers comprehensive understanding of the effect of phase transformation on the electrocatalytic process of MOF-based materials.