Here's why:
* Fluorine is a halogen and exists as a diatomic molecule (F₂). However, when it forms a compound, it loses its diatomic nature.
* Silver is a transition metal and has a +1 charge in this compound.
* Fluorine has a -1 charge.
Therefore, to balance the charges, one silver atom (Ag⁺) combines with one fluorine atom (F⁻), resulting in the formula AgF.