There are many types of chemical bonds and forces that bind molecules together. The two most basic types of bonds are characterized as either ionic or covalent. In ionic bonding, atoms transfer electrons to each other. Ionic bonds require at least one electron donor and one electron acceptor. In contrast, atoms with the same electronegativity share electrons in covalent bonds, because neither atom preferentially attracts or repels the shared electrons.
Ionic bonding is the complete transfer of valence electron(s) between atoms. It is a type of chemical bond that generates two oppositely charged ions. In ionic bonds, the metal loses electrons to become a positively charged cation, whereas the nonmetal accepts those electrons to become a negatively charged anion. Ionic bonds require an electron donor, often a metal, and an electron acceptor, a nonmetal.
Ionic bonding is observed because metals have few electrons in their outer-most orbitals. By losing those electrons, these metals can achieve noble gas configuration and satisfy the octet rule. Similarly, nonmetals that have close to 8 electrons in their valence shells tend to readily accept electrons to achieve noble gas configuration. In ionic bonding, more than 1 electron can be donated or received to satisfy the octet rule. The charges on the anion and cation correspond to the number of electrons donated or received. In ionic bonds, the net charge of the compound must be zero.
This sodium molecule donates the lone electron in its valence orbital in order to achieve octet configuration. This creates a positively charged cation due to the loss of electron.
In this example, the sodium atom is donating its 1 valence electron to the chlorine atom. This creates a sodium cation and a chlorine anion. Notice that the net charge of the resulting compound is 0.
In this example, the magnesium atom is donating both of its valence electrons to chlorine atoms. Each chlorine atom can only accept 1 electron before it can achieve its noble gas configuration; therefore, 2 atoms of chlorine are required to accept the 2 electrons donated by the magnesium. Notice that the net charge of the compound is 0.