Atoms form bonds primarily to achieve a more stable electronic configuration. Most atoms have a specific number of electrons in their outermost shell, known as the valence shell, and they tend to be more stable when this shell is full. This is often achieved by forming bonds with other atoms.
There are several types of bonds that can form between atoms. The most common types are ionic bonds and covalent bonds. Ionic bonds occur when one atom donates an electron to another, resulting in the formation of charged ions that attract each other. For example, sodium (Na) can lose an electron to become a positively charged ion, while chlorine (Cl) can gain that electron to become negatively charged. This transfer creates a strong ionic bond between them.
Covalent bonds, on the other hand, involve the sharing of electrons between atoms. This typically occurs between nonmetal atoms. For instance, in a water molecule (H2O), the oxygen atom shares electrons with two hydrogen atoms, allowing all participating atoms to have a more balanced and stable configuration.
In summary, atoms form bonds to attain greater stability by either sharing or transferring electrons, which leads to the formation of molecules and compounds essential for all matter around us.