Here's why:
* Active metals are metals that readily lose electrons and form positive ions (cations).
* Halogens are nonmetals that readily gain electrons and form negative ions (anions).
When an active metal reacts with a halogen, the metal atom loses electrons to the halogen atom. This results in the formation of a positively charged metal ion and a negatively charged halogen ion. These ions are then attracted to each other, forming an ionic compound, which is also known as a salt.
For example:
* Sodium (Na), an active metal, reacts with chlorine (Cl), a halogen, to form sodium chloride (NaCl), table salt.
* Magnesium (Mg), another active metal, reacts with bromine (Br), a halogen, to form magnesium bromide (MgBr₂).
The reaction between an active metal and a halogen is a classic example of an oxidation-reduction reaction, where the metal is oxidized (loses electrons) and the halogen is reduced (gains electrons).