The process of electrolysis:
When an ionic substance is melted or dissolves, the ions are free to move about within the liquid or solution.
Passing a current through substances that are molten or solution means that the solution can be broken down into elements. This is electrolysis, and the substance being broken down is the electrolyte.
During electrolysis, positively charged ions move to the negative electrode [cathode] and negatively charged ions move to the positive electrode [anode].
Ions are discharged at the electrodes producing elements.