Rechargeable sodium-ion batteries are viable candidates as nextgeneration energy storage devices. Nonetheless, the development of high-potential and stable cathode materials is still one among the open tasks. Here, we propose a combined experimental/theoretical approach to shed light on the effect of magnesium doping on the layered P2-Na 0.67 Mn 0.75 Ni 0.25 O 2 cathode material. The P2-Na 0.67 Mn 0.75 Ni 0.25 O 2 baseline material and doped P2-Na 0.67 Mn 0.75 Ni 0.20 Mg 0.05 O 2 , synthesized via coprecipitation route followed by thermal treatment, have been physically and chemically characterized via X-ray diffraction (XRD), scanning electron microscopy (SEM), and transmission electron microscopy (TEM), as well as electrochemically via galvanostatic cycling and galvanostatic intermittent titration technique (GITT). The Mg-doped material showed stabilization of the high potential plateau and improved cycle life. The analysis of the phase transition with synchrotron operando XRD (SXRD) shows multiple possible intermediate phases ("Z-phase") rather than a pure OP4-like structure. Based on our experimental data and periodic density functional theory (DFT) calculations, the stability of the O2, P2, and OP4 phases for the pristine and Mg-doped systems was investigated to elucidate the origin of the "Z"phase formation in the Mg-doped material.