What determines whether one metal will replace another metal from a compound in a single-replacement reaction?