Final answer:
Magnesium, a group 2 element, has two valence electrons. These electrons are in the 3S orbital and are the ones magnesium loses to form the Mg2+ cation, achieving a noble gas electron configuration like neon.
Step-by-step explanation:
The element magnesium (Mg), which is a group 2 element, has two valence electrons. In the periodic table, elements in Group 2 are also known as the alkaline earth metals, and they all have two electrons in their outermost shell. Magnesium, with an atomic number of 12, has the electron configuration [Ne]3s2. The two electrons in the 3S orbital are the valence electrons that magnesium has. These are the electrons that are involved in bonding.
When magnesium reacts, it tends to lose these two valence electrons in order to achieve a noble gas electron configuration, similar to that of neon. Doing so, it forms the Mg2+ cation. For example, in the formation of magnesium chloride, magnesium donates its two valence electrons to two chlorine atoms, each accepting one electron to become chloride ions (Cl2).
It is important to remember that elements tend to react to achieve a stable electron configuration, often called the octet rule, where they have eight valence electrons. Magnesium achieves this stability by losing its two valence electrons and reaching an electron configuration similar to the noble gas nearest to it in the periodic table (neon).