>>10772873>>10773047>>10775308(2/2)
So you probably ask yourself - how does that explain permanent magnets?
Well, first - when your wire curls around an axis like a spring, you get a magnetic field that looks like the one in the picture. Why that pattern exists in a spiral-shaped wire can be demonstrated with calculus. If you notice, that actually looks very similar to the magnetic field you would expect from a permanent magnet, correct?
Like I mentioned in (1/2), you get a magnetic field any time there's velocity. This also applies to angular velocity, and anything with charge and angular velocity will give you a magnetic field that looks very similar to the one in the picture.
As it happens, electrons do have angular velocity - in the form of 'spin'. While they aren't actually spinning, the laws of how their physics works makes them behave as though they are. So an electron actually produces a magnetic field by the nature of being a charged particle that has angular velocity. But in a large piece of metal, these fields are generally very small and cancel out because the electrons are mostly 'pointing' in random directions.
But why are some objects permanently magnetized? It's because if you align all of the electrons in your piece of iron in the same way (for instance, by striking it with lightning and making a lodestone), the magnetic fields of each electron become aligned together and add up to make one really big magnetic field. Then you can observe stuff like entire magnetized objects sticking together.