The field of energy storage recognizes the tremendous potential of magnesium-ion batteries (MIBs). It is noteworthy that MgFePO4 has emerged as a promising cathode material for MIBs due to its stability, safety, and cost-effectiveness. However, the linear layered structure of MgFePO4 crystals restricts the diffusion pathway of magnesium ions, resulting in narrow diffusion channels and significant intermolecular coulombic forces. As a consequence, MgFePO4 only achieves a specific capacity of 82mAh/g. To address these limitations, MgFeP2O7 was synthesized using the sol-gel method. Electrochemical characterization of MgFeP2O7 demonstrates a specific capacity of 208mAh/g, approximately 2.5 times that of MgFePO4. Additionally, cycling tests conducted at 1A/g reveal a capacity retention rate of 83.16% after 60 cycles. According to MS software simulations, the synthesized MgFeP2O7 exhibits a porous structure with multiple diffusion pathways, wider diffusion channels, and shorter pathways, ultimately leading to a minimum diffusion barrier of 0.62eV. Furthermore, analysis of the electron cloud density reveals electron transfer occurring between Mg/Mg2+ and Fe3+/ Fe 2+ during the charge-discharge process, while the electron cloud surrounding P5+ remains unchanged. Throughout the charge-discharge process, Fe serves as the redox center of MgFeP2O7.