Galvanic cells
In a galvanic cell, the oxidation half-reaction occurs at the anode. Since electrons are deposited on this electrode, it is the negative electrode. The reduction half-reaction occurs at the cathode, which loses electrons and is therefore the positive electrode. The two half-reactions are physically separated, which forces the electrons to move through an external circuit (see Figure 1). This is what generates electricity.
Figure 1: Galvanic cell with two half-cells, external circuit (wires) connecting the anode and cathode, a voltmeter for measuring the cell potential, and a salt bridge.
To allow the reaction to continue, the charges need to be balanced and ions need to be able to move between the cells. Without this movement of ions, one half of the cell would build up a net positive charge and the other half would build up a net negative charge and the reaction would stop. Both anions and cations contribute to the balancing of the charge and the completion of the electric circuit. In a galvanic cell, the ions can move through a salt bridge (see Figure 1) or a porous membrane between the two half-cells.