# How does valency change in a reaction?

There is a reaction given in my book:

$\ce{2FeSO_4 +Heat -> Fe_2O_3 + SO_2 + SO_3}$

I just noticed that on the left $\ce{Fe}$ has valency $2$, while it has $3$ on the right. How can it change valency?

Changing the number of electrons is easy, but this only changes the charge, not the valency. Does this mean that the number of protons changes?

Iron (Fe) Atomic no 26, so 26 electrons to be filled in different orbital. So the electronic configuration is: $\mathrm{1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^6}$. This is the way of filling of electrons according to aufbau's principle. But the exact arrangement is $\mathrm{1s^2 2s^2 2p^6 3s^2 3p^6 3d^6 4s^2}$
So Iron can lose two electrons from the outermost 4s subshell to show a valency of two. Then it can lose another electron from the 3d subshell (penultimate) two show a valency of three. When it shows the valency of two the electron configuration is $\mathrm{1s^2 2s^2 2p^6 3s^2 3p^6 3d^6}$. When it shows the valency of three the electron configuration is $\mathrm{1s^2 2s^2 2p^6 3s^2 3p^6 3d^5}$