Valency is a measure of the combining capacity of an element. It is given in terms of the number of electrons an element is able to share or donate or accept to achieve a fully filled electronic orbital.
In case of argon, the atomic number is 18. It has an electronic configuration of `1s^2, 2s^2, 2p^6, 3s^2, 3p^6`. All the orbitals are fully filled and there is no need of any electron transfer or sharing. Thus, argon has a valency of 0.
Iron, on the other hand, has an atomic number of 26 and an electronic configuration of `1s^2, 2s^2, 2p^6, 3s^2, 3p^6, 3d^6, 4s^2`. An iron atom can either lose 2 electrons from the 4s orbital or lose an additional electron from 3d orbital to achieve higher stability. Thus, it has variable valency (2 or 3), like the other transition elements. And that is why we have ferrous and ferric compounds.
Hope this helps.