Here's how it works:
1. Electricity is applied: A direct electric current is passed through water.
2. Electrodes: The electricity is applied using two electrodes, usually made of inert materials like platinum or stainless steel, submerged in the water.
3. Chemical reaction: The electricity causes the water molecules (H₂O) to break down into their constituent elements: hydrogen gas (H₂) and oxygen gas (O₂).
4. Gas collection: The hydrogen gas is collected at the negative electrode (cathode), and the oxygen gas is collected at the positive electrode (anode).
The chemical equation for this process is:
2H₂O → 2H₂ + O₂
Note: Electrolysis requires a significant amount of electrical energy, making it an energy-intensive process.