Not entirely true (that we understand magnetism). We get some things about it. But not everything.
The nature of physics is such that we never really have 100% confidence in our theories. We are always looking for things the theory under test doesn't predict correctly in the form of an observation. Which means we have to understand what we are measuring. And how we are measuring it.
All of this impacts magnetism. For example, many explanations here discuss electron "spin". Electron "spin" likely doesn't mean the electron is physically spinning.
So what is "spin" and how does it actually contribute to magnetism? And then you have a number of interesting QM properties, such as spin-orbit coupling. Remember, the original model of electrons orbiting nuclei was discarded as the electron accelerating around the nucleus would radiate all of its energy away. So classical orbital "motion" of electrons, literally a current, that should generate a magnetic field, which could couple with the spin of the electron, is not really a classical thing. It is quantum mechanical in nature.
And we really don't fully grasp QM. Some parts we think we understand and can provide some interpretation to. Other parts ... not so clear.
Again, this is why 99 years after Einstein won the Nobel prize, people are still testing relativity, and still testing fundamental/foundational QM. Look at all the work on delayed choice slit experiments[1][2], and many others.
Basically we think we have some level of understanding of QM. And we need a strong understanding of QM to understand QM phenomenon. Like magnetism.
Its not at 100% understanding yet. May never be. But there is so much more interesting science out there, that this is a good thing.
[1] https://www.popularmechanics.com/science/a22280/double-slit-...
[2] http://www.preposterousuniverse.com/blog/2019/09/21/the-noto...