Dipole’s natural alignment
Any magnetic needle (or a dipole) free to move in a region of external magnetic field aligns so that its dipole moment become parallel to external magnetic field i.e. i.e. the position of stable equilibrium. This is because the position of stable equilibrium is the position of maximum stability or minimum potential energy.