Call

Well, both magnesium and barium are $"alkaline earths...."$, the which give dications upon oxidation....

...from Group 2 of . And given Group 2, there are TWO , which are readily oxidized to give dications…

And so $Mg(s) + 1/2O_2(g) rarrunderbrace(MgO)_(Mg^(2+) + O^(2-))$

And likewise...

$Ba(s) + Cl_2(g) rarrunderbrace(BaCl_2)_(Ba^(2+) +2xxCl^-)$