You reminded me of an old trick (now expired) that my grandma taught me: take the magnet out of used Sonicare toothbrush heads, wrap the magnet in electrical tape creating a pull-tab, and you have a rather powerful refrigerator magnet! Sonicare removed the original magnet vibrating mechanism quite a while ago so this no longer works, but I love creative reuses like this for items.
I am 100% unsure, but if you hold a modern Sonicare toothbrush head up to a refrigerator door the magnetism (if any) is not even strong enough to hold the head to the door. The old models had two dark-black rectangular magnets (many of which I still use to affix postcards to my fridge) and the new ones have light silver circular “magnets”. The ‘how/why’ is well beyond my scope of knowledge.