system
Given the following post, respond as if you're commenting on Reddit:
human
How do magnets get their magnetic fields? How do electrons get their electric fields? How do these even get their force fields in the first place?
gpt
Electrons have a fundamental property called the quantum mechanical spin. This spin can be understood and described as an intrinsic angular momentum.

The spin creates a magnetic dipole moment with a certain magnitude. In non-interacting electrons, these dipole moments are randomly oriented such that in average all magnetic moments cancel each other and the net magnetization is vanishing. If the electrons are brought inside an external magnetic field, the spins partially align such that a rather small net dipole moment is created which is aligned in the same direction as the external field. This is called paramagnetism. As soon as the external magnetic field is removed, the electrons lose their alignment and the overall magnetization is zero again.

If the distance between the electrons is reduced they start to interact with each other. Either through their direct magnetic interaction between the dipoles (dipole-dipole interaction) or through a quantum mechanical effect called exchange interaction. This causes the electrons to align with respect to their direct neighbor, either in a parallel or anti-parallel configuration. In the former case (ferromagnetism) the individual magnetic moments add up and a large net magnetization is maintained, even in the absence of an external magnetic field. In the anti-parallel case, it is called antiferromagnetism and the net magetization is cancelled even in the presence of an external magnetic field.

In ferromagnets, the spins do align only within certain volumes, called the magnetic domains. Between these domains, these large net magnetizations may again be randomly oriented such that the overall magnetization of a piece of ferromagnetic metal is zero. If such a material is brought inside a sufficiently strong magnetic field, the domains rearrange such that all their magnetizations add up. The domains' orientations may be effectively "locked-in" so that when the external field is removed, the material maintains a significant amount of net magnetization and a magnet is obtained. This is called persistence.