Here's why:
* Calcium (Ca) is in group 2 of the periodic table, meaning it has 2 valence electrons (electrons in its outermost shell).
* Oxygen (O) is in group 16, meaning it has 6 valence electrons and needs 2 more to achieve a stable octet (8 electrons).
To form a stable compound, calcium loses its two valence electrons to become a positively charged ion (Ca²⁺). Oxygen gains these two electrons to become a negatively charged ion (O²⁻). The opposite charges attract, forming the ionic compound CaO.