The energy of a magnetic moment in an applied magnetic field is:
For a system of atoms:
The Zeeman energy is at a minimum when all the magnetic moments in a sample are in alignment with the applied field.