* Barium is an alkaline earth metal in group 2 of the periodic table. It has 2 valence electrons and tends to lose them to form a +2 cation (Ba²⁺).
* Fluorine is a halogen in group 17 of the periodic table. It has 7 valence electrons and tends to gain 1 electron to form a -1 anion (F⁻).
To form a neutral ionic compound, the charges of the cation and anion must balance. This means you need two fluorine ions (2 x -1 = -2) to balance the +2 charge of the barium ion.