By using cathode made of moving mercury, Na+ ions are discharged in preference to H+ ions because of the nature of electrode. Mercury has strong tendency to form an amalgam with : sodium
Na+ + e– ⟶ Na
Na + Hg ⟶ Na/Hg
When the sodium amalgam dissolves in water, the reaction is
2Na/Hg + 2H2O ⟶ 2NaOH + H2 + Hg