Reactive elements such as alkali metals and halogens are found in nature only as compounds. Such elements are too unstable to remain as stable atoms, therefore they readily combine and form compounds.
Compounds are formed when two atoms combines together to share electrons.
They either lose, gain, or share electrons between themselves.
In the end, they end up becoming more stable.
This is the reason why atoms combine.
Unstable elements are very reactive especially alkali metals and halogens.
On their own, they are unstable and prefers to bond with other atoms in order to gain a measure of stability.
This is why they are found in combined state in nature.