All processes in nature have the tendency to find the status of minimum energy.
Regarding the world of atoms and molecules that means: Valence electrons on an energy level where only a part of possible positons is occupied will prefer to jump to a free position of a lower energy level of another atom or molecule if possible. If this reaction takes place, both atoms will be connected to a new molecule because due to this position change the atom which lost the electron will receive positive charge, the other partner negative charge. The energy level of the new molecule will be lower than the addition of energies of the two atoms or molecules before the reaction.
This process is the basic for all chemical reactions.
A molecule will be saturated and stable as soon as all positions for valence electrons on its maximum energy level are occupied. As long as it is not it will try to find find further electrons to incorporate.