The crude metal is refined by electrolysis. It is carried out in an electrolytic cell containing aqueous solution of the salts of the metal of interest. The rods of impure metal are used as anode and thin strips of pure metal are used as cathode.
The metal of interest dissolves from the anode, pass into the solution while the same amount of metal ions from the solution will be deposited at the cathode. During electrolysis, the less electropositive impurities in the anode, settle down at the bottom and are removed as anode mud. Let us understand this