Covalent bonds are formed when two or more atoms share electrons in order to achieve a stable electron configuration. While it is true that electrons repel each other due to their negative charges, they are also attracted to the positively charged protons in atomic nuclei.
In a covalent bond, the sharing of electrons allows each atom to achieve a more stable electron configuration by filling or completing their outermost energy level (valence shell). By sharing electrons, the atoms can attain a more stable state similar to the noble gases, which have complete outer electron shells.
Consider the example of a molecule of hydrogen (H2). Each hydrogen atom has one electron and needs one more electron to fill its valence shell. When two hydrogen atoms come close together, their electrons are shared, forming a covalent bond. The shared electrons are attracted to both atomic nuclei, effectively holding the two atoms together.
The electron cloud in a covalent bond is not static but rather dynamic, with electrons constantly moving and occupying regions around the bonded atoms. The repulsive forces between electrons are balanced by the attractive forces between the electrons and the nuclei, resulting in a stable arrangement.
It's important to note that while electrons repel each other, they also exhibit wave-like properties and can occupy regions of space with varying probabilities. This allows them to form bonds by sharing and distributing their electron density in a way that minimizes repulsion and maximizes stability.
In summary, covalent bonds form as a result of the delicate balance between the repulsion of negatively charged electrons and their attraction to positively charged atomic nuclei. Through electron sharing, atoms can achieve a more stable electron configuration, leading to the formation of covalent compounds.