Group I elements (alkali metals) have only one valence electron in their outermost shell. They readily lose this electron to achieve a stable octet configuration, forming a +1 ion (e.g., Na+, K+). Non-metals, particularly those in Group VII (halogens), have a high tendency to gain one electron to achieve a stable octet configuration, forming a -1 ion (e.g., Cl-, Br-). The electrostatic attraction between these oppositely charged ions leads to the formation of ionic bonds.
For example, Sodium (Group I) reacts with Chlorine (Group VII) to form Sodium Chloride (NaCl). Sodium readily loses its valence electron to Chlorine, which readily gains that electron. The resulting Na+ and Cl- ions are strongly attracted to each other, forming the ionic compound NaCl.
Group VII elements (halogens) have seven valence electrons. They readily gain one electron to achieve a stable octet configuration, forming a -1 ion (e.g., Cl-, Br-). Metals have a tendency to lose electrons to form positive ions. The electrostatic attraction between the metal cations and the halogen anions results in the formation of ionic bonds.
For example, Magnesium (a metal) reacts with Chlorine (a halogen) to form Magnesium Chloride (MgCl2). Magnesium readily loses two electrons to form Mg2+, and Chlorine readily gains one electron to form Cl-. The resulting Mg2+ and Cl- ions are strongly attracted to each other, forming the ionic compound MgCl2.