Magnet can’t stick to all metals as such as stainless steel, copper, silver, gold and aluminium.
The Earth is a very big magnet it’s north and south pole is highly magnetic.
There are little magnets in the compass that help explorers find a way