Here's why:
* Nuclei are positively charged due to the protons they contain.
* Electrons are negatively charged.
* Opposite charges attract.
In a covalent bond, the shared electrons are attracted to the positively charged nuclei of both atoms involved. This attraction holds the atoms together in the bond.
It's important to note that while "electrostatic attraction" is the fundamental force at play, the specific nature of this attraction in a covalent bond is often referred to as "covalent bonding" or "chemical bonding". These terms encompass the more complex interactions and forces that contribute to the overall stability and properties of the bond.