What is the charge on a magnesium ion? How do they get that charge?

Answer:
Explanation: Magnesium ion has the charge of units +2. Magnesium belongs to the group of Alkaline earth metals which have 2 valence electrons in their outermost shell.
Thus when the valence electrons are lost for the formation of the new chemical bond, then the metal atom will get the charge equal to the lost electrons as the number of positively charged ions increases in comparison to the negatively charged ions.
This leads to the creation of the positive charge on the Magnesium ion.