Electrolysis is a redox process. The reaction at the cathode involves reduction of cations as they gain of electrons while the reaction at anode involves oxidation of anions as they loss of electrons to become neutral.
Example: Dissociation of sodium chloride during electrolysis.
NaCl ⇌ Na+ + Cl-
Cathode : Na+ + e- ⟶ Na (reduction)
Cl- − e- ⟶ Cl(oxidation)
Cl + Cl ⟶ Cl2
Overall reaction : 2NaCl ⟶ 2Na + Cl2