Here's why:
* Lithium (Li) is an alkali metal in group 1 of the periodic table. It has one valence electron, meaning it wants to lose that electron to achieve a stable electron configuration.
* Fluorine (F) is a halogen in group 17 of the periodic table. It has seven valence electrons and wants to gain one electron to achieve a stable electron configuration.
When lithium and fluorine react, lithium loses its one valence electron to fluorine, forming a lithium cation (Li+) and a fluoride anion (F-). These oppositely charged ions attract each other, forming an ionic compound, lithium fluoride (LiF).