Here's why:
* Oxygen's usual oxidation number: Oxygen typically has an oxidation number of -2, except in peroxides (like H2O2) and when bonded to fluorine.
* Hydrogen's usual oxidation number: Hydrogen typically has an oxidation number of +1, except in metal hydrides (like NaH).
* Balancing the charges: Since there are two hydrogen atoms and two oxygen atoms in H2O2, the total oxidation number must be zero. To balance this, each oxygen atom has an oxidation number of -1.
Let me know if you'd like to explore the oxidation numbers of other compounds!