Compass interactions

If we float two identically magnetized needles they will always orient themselves in the same way. Why?

License: CC BY-NC-SA by Khan Academy