Here's why:
* Electron Configuration: Halogens have 7 electrons in their outermost shell. By gaining one electron, they complete their octet, becoming more stable.
* Ionic Bonding: The strong attraction between positively charged metal ions and negatively charged halogen ions (halide ions) results in ionic bonds, forming ionic compounds.
* Covalent Bonding: Halogens can also form covalent bonds with other nonmetals, sharing electrons to achieve stability.
For example:
* Sodium chloride (NaCl): Sodium (Na) loses one electron to become Na+, while chlorine (Cl) gains one electron to become Cl-. The electrostatic attraction between these ions forms an ionic bond.
* Chlorine gas (Cl2): Two chlorine atoms share a pair of electrons to form a covalent bond.
Let me know if you have any other questions!