# Charge of polyatomic ions doesn't equal the charge of ions it consists of?

I'm taking entry level collage chem. class, and we got to this topic that I don't really understand. I think I understood what an ion is (a atom whose amount of electrons is not equal to amount of protons, so it has positive or negative charge). But then polyatomic ions... Lets say peroxide; consists of two Oxygens, whose ions have charge of -2. Consequently, two of these anions are suppose to have charge of -4, but peroxide has charge of -2. How does this work? If polyatomic ions don't just sum the charge of ions they consist of, how else can I predict and understand their charge?

H-O-O-H. The bond in the middle is covalent. Deprotonate to $\ce{{HOO}^{-}}$ (hydroperoxide) then $\ce^{^{-}{OO}^{-}}$, peroxide dianion, $\ce{O2^{2-}}$. You learn it by doing it, having examples, learning what to look for, and gaining understanding. Both oxygens are in the -1 oxidation state.