Answer:
To achive stability
Step-by-step explanation:
Hi,
The atoms are always trying to interact with other atoms, of the same element or a different one. This happens because having unpaired electrons and an incomplete octet in the last atomic level, creates instability in the atoms.
Cause of this they interact with each other, taking, giving or sharing electrons: forming bonds.
An example of this can be seen in the periodic table: the elements that have a complete octet by nature (noble gases), don't bond with other atoms*.
*Note: there are a few exceptions but not very usuals.