In your Chemical equation, Magnesium is added to a Copper(II) Sulfate solution. A displacement reaction occurs. The Copper becomes a solid precipitate and Magnesium replaces it in the solution.
In solution, the ionic compound Copper(II) sulfate separates into Copper cations (positive ions) and Sulfate anions (negative ions). They are held apart by the reorientation of the solvent's (usually water) adjacent molecules. Then when the Magnesium is added. The Magnesium atoms give up their valence electrons to the Copper cations,indicating that Magnesium has the greater tendency to form positive ions (cations).