Le Chatelier's principle
Though according to Ellingham diagrams this reaction is thermodynamically unfavorable, in accordance with the Le Chatelier's principle of equilibria it can still be driven to the right by continuous supply of heat, and by removing one of the products, namely distilling out the magnesium vapor. The atmospheric pressure boiling point of magnesium metal is very low, only 1090 °C, and even lower in vacuum. Vacuum is preferred, because it allows lower temperatures.