An element which is more reactive can displace a less reactive element.
Carbon which is more reactive than iron can displace iron from the ore containing iron oxide, the carbon which is more reactive than iron reduces the iron by removing the oxygen. The iron is displaced. Displacement also occurs in the halogens.