Answer:
elements on the left-hand side of the periodic table such as sodium and magnesium prefer to lose electrons to form a cation because this requires less energy to obtain a stable octet, and vice-versa for the right-hand side of the periodic table e.g. fluorine. However, using this reasoning I am not sure why all transition metals tend to lose electrons rather than gain them.