In order to achieve a stable electronic configuration, electron pairs are shared between atoms of the same or different elements and it results in the formation of a molecule. This is called covalency.
Example:
Nitrogen has valence electrons. It requires more electrons to attain a stable electronic configuration.
It will share valence electrons with other nitrogen atom and results in the formation of .