As a cost-effective element, Mg has been applied as doped inactive atom to improve the electrochemical performance of sodium-ion cathode materials. Herein, we report Mg-substituted Na0.67Mn0.65Ni0.2Co0.15-xMgxO2 composites as high-performance cathode for sodium-ion batteries and investigate the underlying working mechanism using in situ investigation techniques to monitor the operando changes of electrodes. In situ X-ray diffraction investigation demonstrates P2-type structure is well preserved even charged to 4.3 V and the changes of lattice parameters and unit cell volume of Na0.67Mn0.65Ni0.2Mg0.15O2 are alleviated via Mg replacement. As a result, the capacity retention increases from 62% in Na0.67Mn0.65Ni0.2Co0.15O2 to 94% in Na0.67Mn0.65Ni0.2Mg0.15O2. Meanwhile, less CO2 evolution was detected in the coin cell with Na0.67Mn0.65Ni0.2Mg0.15O2 electrode than in that with Na0.67Mn0.65Ni0.2Co0.15O2 electrode in online differential electrochemical mass spectrometry test, suggesting a depressed side reaction between electrode and electrolyte after Mg completely replacing Co. In situ electrochemical impedance spectroscopy investigation further proves Mg is beneficial for the interfacial conductivity enhancement compared to Co, which provides evidence for enhanced high rate capabilities. These comprehensive results provide new viewpoints to explain the improved cycling and rate capabilities from the aspects of crystal structure evolution, coin cell gas evolution and electrolyte/electrode interface conductivity during charge/discharge process.