Daniell’s clever setup isolated the copper and zinc ions from each other (which prevents polarization from interrupting the flow of electricity), while at the same time allowing ions in the electrolyte to move between the two metals, necessary to complete the electrical circuit.
Let’s take a look at the tutorial below to see how this works.
A container lined with copper (the cathode) forms the outer portion of this device, and is filled with copper sulfate, an electrolyte that reacts chemically with the solid copper. Into this a second container is inserted, made of a porous material, containing the zinc (the anode) in an electrolyte of zinc sulfate. When the two metals are connected by an external circuit, the copper attracts the electrons (depicted by small yellow particles) left over in the zinc as that metal oxidizes in the zinc sulfate. (This oxidation causes the zinc to gradually corrode, a process depicted in this tutorial by the darkening of the zinc).
The electrons the copper receives from the zinc through the circuit combine with the positively charged aqueous copper ions (the dark copper colored particles above) to form deposits of solid copper on the metal (depicted by the lighter copper-colored particles adhering to the copper plate).
The sulfates (depicted above as blue and yellow molecules) also play an important role in maintaining this circuit. For every pair of electrons pulled through the wire from the zinc to the copper, a sulfate ion (bearing two negative charges) passes through the solution to compensate, from the copper side through the porous container to the zinc side. This allows the electron flow through the circuit to continue: The zinc metal breaks up into positive aqueous ions (the light gray particles) that combine with the incoming sulfates, releasing more electrons to the system.
This cell was designed to be used in a series of identical cells to create a relatively long-lasting battery, and as such was an improvement over the voltaic pile, the world's first battery invented some three decades earlier.