Recall: A simple binary ionic compounds contains only two elements – a metal and a non-metal. When the ionic compound is in the molten state, the locked ions within the ionic structure will be free to move about (conduct electricity).

A typical setup for electrolysis of molten compounds is shown below:

The metallic ions (cations – $M^{n+}$) will be discharged at the cathode to form a metal atom. The metallic ions are REDUCED to metal at the cathode. (because they gain electrons)

$$M^{n+} + ne^{-} \rightarrow M$$

The non-metallic ions (anions – $N^{n+}$) will be discharged at the anode to form a non-metallic atom. The non-metallic ions are OXIDISED to non-metallic atom at the anode. (because they lose electrons)