Exchange interaction, which is a fancy way of saying spin-spin interaction. However, conditions have to be right (below Curie temperature) otherwise entropy washes the order out.
Two electrons have a total wavefunction $\psi(x_1,x_2, s_1, s_2)$ that is antisymmetric (changes sign) when we interchange $x_1,x_2$ and $s_1, s_2$ (Pauli exclusion principle). You can generalize to any number of identical fermions).
The Coulomb repulsion between two electrons is lower when they are in a spin-aligned state, because by the Pauli exclusion principle, they can't be in the same position, so their combined wavefunction $\psi(x_1,x_2)$ goes to zero when $x_1 \approx x_2$. In other words, they have less probability to be in a position where the electrical potential energy is highest. This state has lower energy. (Convince yourself that $\psi(x_1, x_2, \uparrow, \uparrow) = 0$ if $x_1 = x_2$)
Of course, if their spins are anti-aligned, then they can be close together, so that wavefunction has has a greater probability for them to be in a position where the electrical potential energy is highest. This state has higher energy.