Sodium hydroxide is generally prepared commercially by the electrolysis of sodium chloride in Castner-Kellner cell. A brine solution is electrolyzed using a mercury cathode and a carbon anode. Sodium metal discharged at the cathode combines with mercury to form sodium amalgam. My question is, why sodium ion discharge on the cathode and why not hydrogen ion?
I like what Maurice said "When nobody understands a scientific phenomena, we give it a name. Here the name is overpotential. Here the hydrogen is said to have a big "over potential" on mercury cathode. That is a bright and remarkable way to hide our ignorance."
This is little on the extreme side but people have spent their life on studying the hydrogen evolution reaction. It is a kinetic issue. It was one of the favorite topics of electrochemists. As one can see in the figure, each electrode evolves hydrogen at a different potential in water. Using mercury in the Castner-Kellner cells, allows sufficient negative voltage that can reduce sodium ions even in the presence of water. Additionally, mercury can form amalgams with many metals. Sodium is not an exception. The moment sodium is reduced at the mercury surface, it is dissolved in the mercury pool, which is periodically tapped off.
Figure taken from: An Electrochemistry Experiment: Hydrogen Evolution Reaction on Different Electrodes in the Journal of Chemical Education.