Fact 1: magnetism can cause objects to repel each other. 
Fact 2: Magnetism A compass works on the principle of magnetism and points to the North Magnetic Pole.
A compass works on the principle of the objects ability repel each other.