Simply put, to be stable.
All atoms want to reach the stable and non-reactive state of noble gases. To gain that, they need to either:
1) Completely fill up their outer orbit of electrons
2) Completely lose any extra electrons it has on its outer orbit
This usually occurs through forming bonds with other elements. However, there are a few exceptions e. g. gases; hydrogen exists as