Arkcon, electronegativity is useful, but in this case Gibbs free energy is the key.
For example: Potassium has a much higher electronegativity then magnesium, but this reaction occurs: K2O + Mg → 2 K + MgO. Why? Because ΔG < 0. But this reaction does NOT occur: 2 KCl + Mg → 2 K + MgCl2. ΔG > 0.
The simple reason is that potassium bonds less strongly to oxygen than does magnesium, but it (potassium) bonds much more strongly to chlorine than magnesium does.
Although I don't know why, I expect it is because the equimolar proportions produce a stronger bond than when one set of ions are in double the concentration of it's oppositely charged ions in the crystal lattice. eg. MgCl2 is weaker than KCl and K2O is weaker then MgO.