As I understand it, a displacement reaction is where a more reactive element kicks out a less reactive element from a compound.
For example, chlorine is more reactive than iodine, so chlorine will displace iodine from potassium iodide, yielding potassium chloride and iodine.
If magnesium reacts with water you get magnesium oxide and hydrogen. But hydrogen is generally a lot more reactive than magnesium, so isn't this backwards? The above paragraph predicts that hydrogen would displace the magnesium from magnesium oxide.
So why does it actually happen the other way round?