Iron and manesiu are two common elements found in numerous compounds. magnesium is always in the +2 oxidation state while iron exhibits oxidation states of +2, +3,+4,and +6. why would magnesium not be found in the these upper oxidation states.

Think about the electron configuration.

12 Mg 1s2 2s2 2p6 3s2
26 Fe 1s2 2s2 2p6 3s2 3p6 3d6 4s2

You can see that if Mg loses two electrons it is left with a filled shell of 8 electrons in N=2.
Fe, on the other hand, can lose two electrons from 4s2 and have 6 electrons remaining in the third shell, all with approximately the same energy as the 4s electrons; therefore, Fe is more likely to exhibit numerous oxidation states as well as the +2 state.

The oxidation state of an element refers to the hypothetical charge it would have if all the shared electrons in its compounds were assigned to the more electronegative atom. In other words, it represents the number of electrons gained or lost by an atom when it forms a chemical bond.

The oxidation states of elements can vary due to their electronic configurations and the number of valence electrons. In the case of magnesium, it has a stable electronic configuration with two valence electrons in its outermost energy level. To achieve a full octet (8 valence electrons), magnesium readily loses these two electrons to form a stable +2 oxidation state. This makes magnesium a very reactive metal that readily forms compounds, especially in the +2 oxidation state.

On the other hand, iron has a more complex electronic configuration with multiple energy levels and orbital contributions. The presence of these different energy levels allows iron to accommodate a variety of oxidation states. Iron can lose either two or three valence electrons to achieve the +2 or +3 oxidation states, respectively. Additionally, iron can also gain or lose additional electrons to form the +4 and +6 oxidation states, although they are less common.

The reason why magnesium is not commonly found in higher oxidation states compared to iron is primarily due to its electronic configuration and the number of valence electrons. Magnesium has a more stable configuration when it loses its two valence electrons, whereas iron can lose or gain multiple electrons to achieve different oxidation states. Therefore, the ability of iron to access a wider range of oxidation states is a result of its electronic structure, which differs from that of magnesium.