Because it is about stability. Atoms with octet configuration in the valence shell remain stable and those that lack are unstable and try to attain the required stability by combining with other atoms ( we mean bonding with other atoms). In trying to gain stable configuration atoms may lose, gain, or share electrons.
The atoms in molecules, crystals, diatomic gases and most of the physical environment around us are held together by chemical bonds. Essentially, you will find 3 types of bonds: covalent, ionic, and metallic. Hydrogen bonding is a special case of dipole‐dipole attraction. Molecules formed as a result of chemical bonding could be as simple as oxygen molecules or as complex as the DNA molecules with thousands of atoms linked together through bonds.
(The substances which we come across daily do involve the bonding between their atoms.For example, covalent bonding is seen between the carbon atoms of diamond.NaCl which is usually referred as table salt involves ionic bonding between Na+ and Cl− ions.A precious metal gold is an example of substance having metallic bonding. Silicon is an example of metalloid. Refer figure).