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.

Even good answers here have a legitimate diversity of explanation.  The world is complicated and dirty.  Unlike physicists (quantum gravitation, SUSY, dark matter), we can test our predictions with experiments.  Chemists are not too stinking proud to admit we were wrong, e.g., benzene displacements then palladium catalysis.  That is how we make real world progress, by discovering footnotes.

Introductory inorganic does not have wiggle room.