(a) Besides carbon, displacement reactions are used to obtain metals from their oxides. Highly reactive metals such as sodium, calcium and aluminium are used as reducing agents, because they can displace metals of lower reactivity from their compounds. These displacement reactions are highly exothermic; the heat evolved is so large that the metal is produced in the molten state.
Example 1: When manganese dioxide is heated with aluminium powder, aluminium displaces manganese:
3MnO2(s)+4Al(s)→3Mn(l)+2Al2O3(s)+heat
Example 2: In the thermit reaction, aluminium displaces iron from iron(III) oxide. The molten iron formed is used to join railway tracks and cracked machine parts:
Fe2O3(s)+2Al(s)→2Fe(l)+Al2O3(s)+heat
In both, the more reactive metal takes the oxygen and the less reactive metal is set free.
(b) Metals high up in the reactivity series, such as sodium, magnesium, calcium and aluminium, have more affinity for oxygen than carbon has. So carbon cannot take oxygen away from their oxides, and heating these oxides with carbon does not give the metal. These metals are obtained instead by electrolytic reduction; for example, sodium, magnesium and calcium are obtained by electrolysis of their molten chlorides.

The three routes from ore to metal, and what decides which one is used.