You can split the ionic equation into two parts, and look at it from the point of view of the magnesium and of the copper(II) ions separately. This shows clearly that the magnesium has lost two electrons, and the copper(II) ions have gained them.
These two equations are described as "electron-half-equations" or "half-equations" or "ionic-half-equations" or "half-reactions" - lots of variations all meaning exactly the same thing!
Any redox reaction is made up of two half-reactions: in one of them electrons are being lost (an oxidation process) and in the other one those electrons are being gained (a reduction process).
Working out electron-half-equations and using them to build ionic equations
In the example above, we've got at the electron-half-equations by starting from the ionic equation and extracting the individual half-reactions from it. That's doing everything entirely the wrong way round!
In reality, you almost always start from the electron-half-equations and use them to build the ionic equation.
Example 1: The reaction between chlorine and iron(II) ions
Chlorine gas oxidises iron(II) ions to iron(III) ions. In the process, the chlorine is reduced to chloride ions.
You would have to know this, or be told it by an examiner. In building equations, there is quite a lot that you can work out as you go along, but you have to have somewhere to start from!
You start by writing down what you know for each of the half-reactions. In the chlorine case, you know that chlorine (as molecules) turns into chloride ions:
The first thing to do is to balance the atoms that you have got as far as you possibly can:
ALWAYS check that you have the existing atoms balanced before you do anything else. If you forget to do this, everything else that you do afterwards is a complete waste of time!
Now you have to add things to the half-equation in order to make it balance completely.
All you are allowed to add are:
hydrogen ions (unless the reaction is being done under alkaline conditions - in which case, you can add hydroxide ions instead)
In the chlorine case, all that is wrong with the existing equation that we've produced so far is that the charges don't balance. The left-hand side of the equation has no charge, but the right-hand side carries 2 negative charges.
That's easily put right by adding two electrons to the left-hand side. The final version of the half-reaction is:
Now you repeat this for the iron(II) ions. You know (or are told) that they are oxidised to iron(III) ions. Write this down:
The atoms balance, but the charges don't. There are 3 positive charges on the right-hand side, but only 2 on the left.
You need to reduce the number of positive charges on the right-hand side. That's easily done by adding an electron to that side:
Combining the half-reactions to make the ionic equation for the reaction
What we've got at the moment is this:
It is obvious that the iron reaction will have to happen twice for every chlorine molecule that reacts. Allow for that, and then add the two half-equations together.
But don't stop there!! Check that everything balances - atoms and charges. It is very easy to make small mistakes, especially if you are trying to multiply and add up more complicated equations.
You will notice that I haven't bothered to include the electrons in the added-up version. If you think about it, there are bound to be the same number on each side of the final equation, and so they will cancel out. If you aren't happy with this, write them down and then cross them out afterwards!
Example 2: The reaction between hydrogen peroxide and manganate(VII) ions
The first example was a simple bit of chemistry which you may well have come across. The technique works just as well for more complicated (and perhaps unfamiliar) chemistry.