When you are performing an electrolysis in aqueous solution, you are also oxidizing and reudcing water via the following reactions.
Oxidation: 2H2O --> O2 + 4H+ + 4e- (Anode)
Reduction: 2H2O + 2e- --> 2OH- + H2 (Cathode)
If you multiply the bottom equation by 2 and add the two together you get
H2O --> H2 + O2
In the oxidation reaction, oxygen is oxidized and in the reduction reaction, hydrogen is reduced