Chemistry - Why does a chemical have more than one oxidation number?
Solution 1:
Because a lot of what you have been taught in school is a lie.
In this particular case, you've probably been taught about the octet rule, a rule which makes it seem as if any given element should have exactly two oxidation states; 'n' and '8-n', where n is a simple function of it's location in the periodic table.
The truth, as always, is a little more complicated:
Compared to the (somewhat) well-behaved non-metals in the upper right corner of the periodic table, most metals have a lot for electrons. At 26, iron is a lightweight, but already there you have 4 (common!) oxidation states, the two most common ones being iron(II) and iron(III).
One reason for this is that while iron atoms have a "the lowest energy state", it's difficult to get at without first coming across several "a (locally) lowest energy state".
Its four oxidation states represent local minima, and moving between them requires an activation energy, making each of the states relatively stable, but possible to dislodge, i.e. metastable.
Solution 2:
As you told oxidation number(oxidation state) is number assigned to atom, ion or compound which represent electron gain or lost by atom, ion or compound.
Some element have more than one oxidation number, because they act differently when they combine with other element. Eg. Oxygen (act differently when combined with peroxide or superoxide.)
Some element have more than one oxidation number, because they can gain as well as loss electrons.So they have negative as well as positive oxidation number.
Almost all the elements have more than one oxidation state including Magnesium and potassium. You can see the list of oxidation state of all the elements here