Impure copper is the anode and pure copper is the cathode with the electrolyte being a copper sulfate solution. At the anode, the copper loses electrons and copper forms positive ions and goes into solution. At the cathode, the copper gains electrons and it is deposited/collected. The impurities/ sludge collect at the bottom because the impurities are not attracted to electrode