Without getting into too much detail, chemical bonds form because the stability gained from the sharing of electrons (e.g. filling octets) is greater than the destabilization from the electrostatic repulsion of overlapping the electron clouds of the atoms.