Electrolytes are ionic compounds in the molten state or dissolved in solution.

The ions in electrolytes are free to move within the liquid or solution.

liquids and solutions that are able to conduct electricity are called electrolytes.

Ionic compounds in the solid state cannot conduct electricity.

Passing an electric current through electrolytes causes the ions to move to the electrodes.

Positively charged ions move to the negative electrode, which is the cathode.

Negatively charged ions move to the positive electrode, which is the anode.

Therefore the metal and hydrogen forms at the cathode and non-metal always forms at the anode.