What are the reason for exhibiting variable valency?

What are the reason for exhibiting variable valency?

The electrons present in the outermost shell of an atom are called valence electrons.
If the valency electrons are removed, the remainder is called Core.
In case of transition elements, the core is not stable.
So after the removal of valency electrons, one or more electrons can be lost from the outermost shell of the core also.
Hence these elements show two or more different valencies i.e. they have variable valency.
Example: Iron has two valencies Fe+2 and Fe+3