If the angle between the positive normal and the magnetic field is 0, then the equilibrium is stable. It follows directly from the fact that U = - mBcos θ  where m is the magnetic moment. So, when θ is 0, Potential energy, i.e. U of the system is negative, the system is more stable. But if θ is 180°, U is positive or the system is unstable.Stability of a system depends on its energy and every system tries to minimise its energy. The configuration of the system with least energy is most stable and the configuration with the most energy is least stable or unstable.