How does overvoltage affect the products of electrolysis?
When you electrolyse an aqueous solution of NaCl, the product formed at cathode is H2 gas (preferential discharging), but the product formed at anode is Cl2 gas. 


There is another complication. The book is missing the fact whether chlorine or oxygen is evolved depends on the concentration of the salt. At low salt concentrations, oxygen will be formed and at high NaCl concentrations $\ce{Cl2}$ will be produced at the anode.

Keep in mind the thermodynamic "competition" is between the oxidation of water and oxidation of chloride ions. Electrochemists have spent their lives and careers in understanding the oxidation reduction of water for hundreds of years. So if you are slightly confused and you have a lot of questions that is a sign of a healthy scientific mind. I am glad that you did not digest what the textbook was saying right away.
Wikipedia hints as how complex is the process of hydrogen and oxygen production at a electrode.



The numbers which you are quoting are like comparing apples and oranges.
This half cell
$$\ce{2H2O(l)} → \ce{O2(g) + 4 H+(aq) + 4e−}$$ $E^o$= +1.23 V is valid for pH of 0, i.e., 1 M H$^+$
ion. Your aqueous NaCl solution is not present in 1 M H$^+$.

You might need to use the Nernst equation to see what is the true potential at a neutral pH.