If for example, an atom had nine electrons, the first two orbit very close to the nucleus, the next seven orbit a little farther away. The outer seven electrons are less tightly held than the inner two electrons because they are further away from the positively charged nucleus. If this atom gets close to another atom, with a loosely held electron in its outer shell, a new orbital will become available to the loosely held electron. This new electron orbital is bound to both atomic nuclei and has a lower energy level than the original electron orbital. The electron can spontaneously jump to it and emit a photon with the excess energy. Now we have an electron orbiting both atoms which results in the atom that provided the electron having a small net positive charge and the other atom having a small net negative charge. The two atoms are now held together by the electromagnetic force of attraction between positive and negative charges. This is called a covalent bond. To break this bond needs the same amount of energy as was released when it was formed.