I give you the word equation first and then the chemical equation.
Water + electricity = Hydrogen + Oxygen
What that means is that if you have same sort of mineral that won't separate with the electricity put in the water, then you get the water "breaking down" into oxygen and hydrogen.
2H2O ===> 2H2 + O2
At this stage you don't have to worry about what the 2 in front of the hydrogen and the 2 in front of the water means. One of the properties of water is that it is hard to get the water molecule to break down. Not impossible. Just hard.