When sodium and chlorine combine, chlorine gains an electron and sodium loses an electron. As a result, the chlorine gains a negative charge and the sodium gains a positive charge. This process is known as ionic bonding.
The electrons of an atom are not found in the nucleus with the protons and neutrons. Instead, they travel around the nucleus in orbitals. These orbitals are also called energy shells. An element is most stable when it has eight electrons in its outer energy shell.
The octet rule is a chemistry principle that says elements lose or gain electrons in an attempt to become more stable. Scientists say they attempt to attain noble gas configuration or become more like the nearest noble gas on the periodic table. When chlorine reacts with other elements, for example, it attempts to attain the electron configuration of argon.
Because chlorine only needs one more electron to attain noble gas configuration, it is a very reactive element. It is possible for a chlorine atom to gain two electrons, but it would require additional energy to pick up the second electron. Dr. Anne Marie Helmenstine says chlorine is more likely to participate in reactions where it gains one electron.