The needle on those compasses are not actually magnetised at all. How it works is that the pivot has a needle with a magnet underneath it, they both rotate separately and independently of each other, the magnet itself absorbs the vertical force of the magnetic field so the needle is unaffected and stays horizontal. The magnet rotates the needle above even though it is not connected to it and the needle remains level due to magnet absorbing the vertical pull.
Brilliant! Thank you very much for the explanation. I have to admit that, up until now, my only concern was that it worked and helped me navigate accurately; now I have a clearer understanding of how it works which is always a good thing!