Why does the element Iron have a variable valency, sometimes Fe+2 and sometimes Fe+3?
Iron, as a transition metal, shares the same outer electronic configuration as the rest of the metals in its class, meaning the 4s orbitals are all the same. Only the inner 3d orbitals change among these metals. However, these orbitals (4s and 3d) are close in energy, so sometimes Iron gives up its 2 outer 4s electrons, and sometimes it also gives up an inner 3d electron, resulting in an Iron ion having either 2 or 3 positive charges (Fe++ or Fe+++)
iron is a transition metal and because its orbitals are so close energy wise they tend to give up either 2 or 3 electrons at time.
Since Iron, Fe, is a transition metal it usually will conform it's positive charge to an element or compound that already has a set negative charge for example...
FeO Oxygen has a set oxidation number of -2 which would automatically make iron have a +2 charge/
FePO3 PO3 has a set oxidation number of -3 which would make iron have +3 charge.
Also since Iron is a transition metal it usually gives up those two or three electrons in order for the compound to have an oxidation number of 0.
iron has 2 electrons in its 4s orbital and 6 electrons in the five 3d orbitals , one being paired others having a single electron each. When iron has +2 valency it has actually lost its 4s electrons but when it has a valency of +3 ,it has lost 4s electrons along with one electron from the paired electrons in 3d orbital , thereby leaving unpaired electrons in each of the five 3d orbitals , this is because partially filled d orbitals have extra stability.