Charges are because of the electrons in the outer valence shells and whether or not electrons are more likely to be lost or gained
If an atom has a charge of -1
Them when that atom bonds with another element, it will lose its electron - it only has one, it’s so easy to lose. :0
If an atom has +4/-4 electrons it usually covalently bonds because it is halfway
Hope that helps :D