This arrangement is called a galvanic cell. A typical cell might consist of two pieces of metal, one zinc and the other copper, each immersed each in a solution containing a dissolved salt of the corresponding metal. The two solutions are separated by a porous barrier that prevents them from rapidly mixing but allows ions to diffuse through.
If we connect the zinc and copper by means of a metallic conductor, the excess electrons that remain when Zn2+ ions emerge from the zinc in the left cell would be able to flow through the external circuit and into the right electrode, where they could be delivered to the Cu2+ ions which become "discharged", that is, converted into Cu atoms at the surface of the copper electrode. The net reaction is the oxidation of zinc by copper(II) ions:
Zn(S)+Cu2+(aq)⟶Zn2+(aq)+Cu(s)