Magnesium partitioning between metal and silicate was experimentally investigated between 34 and 138 GPa, 3,500 and 5,450 K using laser‐heated diamond anvil cells. The 22 measurements are combined with previously published data (total of 49 measurements) to model magnesium metal‐silicate partitioning using a thermodynamically consistent framework based on the interaction parameter formalism. The observations support the mechanism of MgO dissolution in the metal, ruling out other mechanisms. The magnesium partition coefficient depends on temperature and metal composition, but not on pressure or silicate composition. The equilibrium concentration and the exsolution rate of MgO in Earth's core can therefore be calculated for any P, T, and composition. Using a core thermal evolution model, the buoyancy flux converts to a magnetic field at Earth's surface, with dipole intensities between 40 and 70 μT prior to inner core growth, consistent with the paleomagnetic record going back to the Archean.