An atom is electronically stable when its outermost shell is full. Neon, for example, has 2 K shell electrons and 8 L shell electrons, giving it a stable configuration. Helium, neon and argon are inert gases, which are the only elements, out of the first 35, that have a stable electronic configuration. As such, they don’t naturally form compounds with other elements. An atom having less than a complete outermost shell has an unstable electronic configuration. The compulsion for atoms to have a stable electron configuration, thereby lowering their overall energy state, is the primary driving force for atoms bonding together to form compounds.
Electrons in the outermost shell are known as the valence electrons. It is these electrons that are most often involved in bonding. Electrons can move up and down between shells, be added to an atom, and also be removed entirely from an atom. When one or more electrons are added or removed from an atom what remains is known as an ion. Normally the electronic charges on an atom are balanced, with the negative electrons balancing the positive protons. When an electron is removed the remaining ion will have a positive charge. When one is added the charge on the ion will be negative.
There are two different ways that atoms can be bound together.
1. Primary bonds - these are strong bonds that may be ionic, covalent, or metallic.
2. Secondary bonds - these are weak bonds that may be van der waals or hydrogen.
Note: although these different bonds are distinguished, in many materials there exists a mixture of different bonds. A bond is rarely purely ionic or covalent and usually will be a combination of both.