Answer :

Overall the ionic compound cannot be charged, so all charges of the ions must be balanced. This means if you know the charge of 1 ion (E.G. Ca2+ ion) and you know the charge of the other ion (E.G. Cl1-) then you can work out that to make the overall charge 0, there must be double the amount of chlorine ions than calcium ions present. From this, you can work out the formula must be CaCl2.