system
Given the following post, respond as if you're commenting on Reddit:
human
Why can water undergo electrolysis despite being covalently bonded?

Ask my chemistry teacher, she had no clue.
gpt
With two hydrogens on one side and one oxygen on the other, water is a polar molecule. This makes it a great solvent and also allows you to divert a running tap using a statically charged rod. By applying charge across the water, you pull apart the molecule.

The ions then travel through the water to the electrodes and donate/acquire an electron, bonding to similar atoms in their elemental form and bubbling out as a gas.

TL;DR there is a charge differential across the water molecule.