Polyatomic ions have a charge because they have more or fewer valence electrons than the neutral atoms that make up the ions.
The most common polyatomic cation is the ammonium ion,
It has eight valence electrons.
The positive charge arises because the 8 negative electrons in
The phosphate ion has 32 valence electrons.
The negative charge is caused by the three extra electrons that came from some outside source, e.g., metal atoms that donated their valence electrons and formed cations.