Electrolysis is a process that uses electrical energy to decompose an electrolyte. The electricity must be direct current (d.c.), supplied by a battery or power pack, so that one electrode is always positive and the other always negative.
Two electrodes are placed in the electrolyte and connected to the supply. The electrode joined to the positive terminal is the anode and the electrode joined to the negative terminal is the cathode. Inert electrodes, such as graphite or platinum, do not react, so they just carry current to and from the electrolyte.
When the current flows, the electrolyte is broken down into simpler substances, which form at the electrodes. For example, electrolysis of molten lead bromide produces lead and bromine. The electrolyte must be molten or dissolved in water, because the ions must be free to move for the current to pass.