Both metals Mg and Fe can reduce copper from a solution having Cu2+ ion, according to equilibria.
Mg(s)+Cu2+(aq)⇌Mg2+(aq)+Cu(s);K1=6×1090
Fe(s)+Cu2+(aq)⇌Fe2+(aq)+Cu(s);K1=3×1026
Which metal will remove cupric ion from the solution to a greater extent?