The reaction of magnesium with water is exothermic. With cold water, the reaction is very slow and any heat generated dissipates. The product is magnesium hydroxide, Mg(OH)2. With steam, the reaction is much faster and occurs at a high temperature. At this high temperature, any magnesium hydroxide that might form would thermally decompose into magnesium oxide and water: Mg(OH)2(s)→MgO(s)+H2O(g). So, the final product is the more thermally stable magnesium oxide, MgO.