* Calcium (Ca) is a metal and tends to lose electrons to form a positive ion (cation). In this case, it loses two electrons to achieve a stable electron configuration.
* Chlorine (Cl) is a nonmetal and tends to gain electrons to form a negative ion (anion). It gains one electron to achieve a stable electron configuration.
Since calcium loses two electrons and each chlorine atom gains one electron, you need two chlorine atoms to balance the charges. This results in the chemical formula CaCl₂.