The interlayer exchange coupling in Fe/MgO(001) superlattices is found to increase exponentially with decreasing temperature. Around 150 K, the field-induced response changes from discrete switching-governed by field-driven domain propagation-to a collective rotation of the magnetic layers. This transition is accompanied by a change in the magnetic ground state from 180 degrees (antiferromagnetic) to 90 degrees alignment between adjacent Fe layers. These effects are argued to arise from quantum-well states, defined by the total thickness of the samples.