Atoms that share electrons form covalent bonds. In a covalent bond, the electrons are not transferred from one atom to another, as is the case in ionic bonds, but rather are shared between the atoms. This sharing allows each atom to achieve a more stable electron configuration, often resembling that of the nearest noble gas. Covalent bonds can occur between nonmetal atoms and often result in the formation of molecules. For example, in a water molecule (H₂O), the oxygen atom shares electrons with two hydrogen atoms, creating a stable arrangement that holds the molecule together.