<u>Answer:</u> Because electrons are getting transferred from iron to oxygen.
<u>Explanation:</u>
Oxidation-reduction reaction or redox reaction is defined as the reaction in which oxidation and reduction reaction occur simultaneously.
Oxidation reaction is defined as the reaction in which a substance looses its electrons. The oxidation state of the substance is increasing.
Reduction reaction is defined as the reaction in which a substance gain electrons. The oxidation state of the substance gets reduced.
For the reaction of rusting of iron, the equation follows:

<u>On reactant side:</u>
Oxidation state of iron = 0
Oxidation state of Oxygen = 0
<u>On product side:</u>
Oxidation state of iron = +3
Oxidation state of Oxygen = -2
Half reactions of oxidation and reduction are:
Oxidation: 
Reduction: 
As, oxidation state of iron is increasing from 0 to +3, so it is getting oxidized and undergoes oxidation reaction. And, oxidation state of oxygen is getting decreased from ) to -2, so it is getting reduced and is considered as a reduction reaction.
Here, electrons are getting transferred from iron to oxygen. Hence, rusted of iron is an example of a redox reaction