The oxidation state of an element is based on its electronic configuration. The various oxidation states of a transition metal are due to the involvement of (n-1)d and outer ns electrons in bonding.
For example, Ti (22, electronic configuration [Ar]3d24s2) can show three oxidation states (+2, +3 and +4) in various compounds like Ti02 (+4), Ti203 (+3) and TiO (+2).
The non-transition elements, mainly thep-block elements can show a number of oxidation states from +n to (n – 8) where, n is the number of electrons present in the outermost shell. For example, phosphorus can show -3, +3 and +5 oxidation states.
Lower oxidation states are ionic as the atom accepts the electron or electrons to achieve stable configuration while higher oxidation states are achieved by unpairing the paired electrons and shifting the electrons to vacant d-orbital.