Consider two isolated hydrogen atoms moving towards each other as shown in Figure. As they approach each other, the following interactions are observed.
Fig: electrical origin of interatomic forces
(i) Attractive force A between the nucleus of one atom and electron of the other. This attractive force tends to decrease the potential energy of the atomic system.
(ii) Repulsive force R between the nucleus of one atom and the nucleus of the other atom and electron of one atom with the electron of the other atom. These repulsive forces always tend to increase the energy of the atomic system.
There is a universal tendency of all systems to acquire a state of minimum potential energy. This stage of minimum potential energy corresponds to maximum stability.
If the net effect of the forces of attraction and repulsion leads to decrease in the energy of the system, the two atoms come closer to each other and form a covalent bond by sharing of electrons. On the other hand, if the repulsive forces are more and there is increase in the energy of the system, the atoms will repel each other and do not form a bond.