system
Given the following post, respond as if you're commenting on Reddit:
human
If a magnetic field requires a moving electric charge, how does a permanent magnet work?

And even if a permanent magnet has some sort of current flowing in it, how does the current stay moving without the input of energy?
gpt
First of all, a magnetic field doesn't necessarily require a movement of charge. All it needs is a change in electric flux with time.

Second of all in an atom, the electrons are "spinning" around the nucleus, usually in random directions. Every single one of them is like a tiny bar magnet (the more technical term is dipole). In an object where the electrons are mostly "spinning" in the same direction, all the dipole moments sum together and make one big dipole.