The tendency of main group elements to achieve a stable configuration of eight valence electrons, known as the octet rule, drives their chemical reactivity. Main group metals, such as sodium, typically lose electrons to resemble the noble gas preceding them in the periodic table. For example, sodium (atomic number 11) aims to lose one electron to attain the electron configuration of neon (atomic number 10), resulting in a stable, filled outer shell.
Conversely, nonmetals like chlorine (atomic number 17) gain electrons to emulate the noble gas that follows them. Chlorine needs to gain one electron to achieve the electron configuration of argon, thereby completing its outer shell. This behavior of gaining or losing electrons is motivated by the desire to create fully filled energy levels, which enhances stability and reduces chemical reactivity.
To illustrate, consider lithium and fluorine. Lithium has one valence electron, represented by the electron configuration 2-1, while fluorine has seven valence electrons, with a configuration of 2-7. As a group 1A element, lithium loses its single valence electron, becoming a lithium ion (Li+) with a filled outer shell, similar to helium. The lost electron is transferred to fluorine, which then becomes a fluoride ion (F-) after gaining that electron, achieving a filled outer shell akin to neon.
In summary, the interactions between metals and nonmetals in the context of the octet rule highlight their tendency to gain or lose electrons to attain the electron configurations of the nearest noble gases, thereby achieving greater stability.