This answer represents a magnesium atom which has a total of 12 electrons and no charge. When a cation is formed, an electrons must be lost...one for each positive charge. The magnesium cation has a charge of +2 so two electrons must be lost.