Hello,
The alignment of a freely suspended magnet is influenced by the earth’s magnetic field. Our earth is assumed to have a strong magnet with south pole near the geographic north pole and the north pole of the magnet near the geographic south pole. This is why when a magnet is freely suspended, the north pole of the magnet points towards the geographic north pole of earth.
Hope this helps,
Keep posting and have a great day!