Chemical bonds are the attachments of atoms to one another. Compounds are formed when atoms attach to one another. So a compound has at least two atoms. Electron Affinity is the reason chemical bonds are formed. This affinity is a force that repels, or attracts, or shares electrons base on the best path to valence-shell equilibrium. An atom will donate the electrons in its valence-shell if the donation provides the best path to valence-shell equilibrium. An atom that accepts the donated electrons does so because it is the best path to its valence-shell equilibrium. When two such atoms bond, the bond is called an ionic bond.
In ionic bond, one element is a donor of electrons while the other is an acceptor of electrons. The element that donates electrons becomes a positively charged ion while the element that accepts electrons becomes a negatively charged ion. Consider the elements sodium (Na) and chlorine (Cl) The electron configuration of sodium is 1s22s22p63s1. The electron configuration for chlorine is 1s22s22p63s23p5. Sodium is willing to donate its 1 electron of its 3s orbital in order to attain a stable neon state, chlorine is willing to accept sodium's electron to complete its 3p orbital in order to attain a stable argon state. So the transfer is made and sodium becomes Na+ ion thereafter and chlorine becomes Cl-.
Some atoms are only willing to share their valence electrons. When such atoms bond, the bond is called a Covalent Bond. In covalent bond, elements share the electrons of their outer-most shell. Consider the elements carbon (C) and hydrogen (H) with atomic numbers 6 and 1 respectively. The electron configuration of carbon is 1s22s22p2. The electron configuration of hydrogen is 1s1. Consequently, carbon is able to share its 4 electrons in its outermost shell with 4 hydrogen atoms. Each of the bond consists of one electron from carbon and one electron from hydrogen. The compounds formed from covalent bonds are called molecules. The line joining the nuclei of two bonded atoms in a molecule is called the bond axis. The distance between nuclei along the bond axis is called the bond length. The angle between two bond axes is called the bond angle.
Often covalent bonds are not wholly covalent. In other words, the elements involved in a covalent bond may not share the electrons 50-50, for example, one element may have more power of attraction for the electrons than the other. The relative tendency of an atom to attract electrons to itself when bonded to another atom is called Electronegativity (the number assigned to elements as estimates of their power of attraction for electrons in a covalent bond). In General, if the electronegativity difference between two elements in a chemical bond is 1.7, the bond is considered to be 50% ionic. If the difference is greater that 1.7, the compound formed by the elements is considered to have an ionic structure. If the difference is less than 1.7, the compound is considered to have a covalent structure.
The atoms of metals have 1, 2, or 3 valence electrons so they do not form typical covalent bonds with one another. They also do not form ionic bonds because their electron affinities are similar. However, metallic atoms bond to one another by sharing the sea of valence electrons (delocalized electrons) in the electron clouds formed as a result of the overlapping of their valence orbitals. This type of bond that attach the atoms of metals is called metallic bond.
The orbital space wherein the grouping/interaction of atoms occur, the force that effects the grouping/interaction and the resultant change of the grouping/interaction are all Pj Problems. Conseqently, chemical bonds are expressions of Pj Problems.