Preparation of NaOH:
In aqueous solution NaCI and water are dissociated as-
NaCI (aq) ↔ Na+ (aq) + Cl– (aq)
H2O (l) ↔ H+ (aq) + OH– (aq)
When electricity is passed through the concentrated aqueous solution of NaCl then Na+ and H+ ion go to cathode electrode and since H+ has more reducing potential than Na+ and that is why it forms H2 accepting electron from cathode. On the other side Cl– & OH– ions are drawn towards anode. Since Cl– ion concentration is more than OH– and hence left electron to the anode and forms Cl2 gas.
Now the remaining OH– and Na+ react to each other and form NaOH.
Na+ (aq) + OH– (aq) — NaOH (aq)