Charge on an ion = no. of protons - no. of
electrons.
 3717Cl gains one electron g
 13856Ba loses two electrons g
Like charges repel each other, opposite attract.