In the Insane Clown Posse’s recently released song “Miracles” you will find the lyrics
I’ve seen miracles all around me, stop and look around its all astounding, water, fire air and dirt, fucking magnets, how do they work?
I don’t want to talk to a scientist, ya’ll motherfuckers lying and getting me pissed
If this was Tom Waits I might not be offended. But I’ll answer ICP’s question, not because they’ve asked it, but because I think there’s honest wonder and fascination in how magnets work and also because the best explanation you can get will come from a scientist.
The most common explanation has to do with the magnetic “fields” that some materials create by net effect of their composition – some significant portion of their atoms/molecules has an inherent magnetic property that is oriented along the same direction. Nearly all materials are magnetic, but in most objects the magnetic orientations are scrambled and cancel each other out. If you were to take to a few hundred one-inch magnets and throw them together you would likely end up with a lump that is much weaker magnetically than if you were to take the time to orient their poles along the same direction. In short, commonplace magnets display an effect that is the sum of many small magnetic dipoles which have an associated field – a property of space dependent upon proximity to the magnet.
Objects with magnetic charge will feel a force when placed in a magnetic field, a phenomenon that is easily studied and well understood. There is a tremendously accurate description, Maxwell’s laws, that relies on mathematics (involving things like potential energy and field gradients.) But honestly this is not the most complete description we have – for that you need to invoke quantum mechanics, due to the following reasons: The explanation for why atoms and molecules have a magnetic property involves angular momentum (orbital angular momentum and the inherent property called “spin”) and movement as defined by a probabilistic wave function, and that the minutiae of magnetic fields are so-called “virtual particles.”
According to Quantum Mechanics and earlier theories, magnetic fields are created by moving electric charges, or perhaps with QM it’s better to say charges with energy, since “movement” in this case means something different than what we usually imagine. It also says that charges with angular momentum create magnetic fields. So take, for example, an electron bound in an atom. The electron has angular momentum and charge (neither of which are separable from the particle) and therefore it has a magnetic component. Electrons behave as if they contain a tiny magnet.
The second quantum component, virtual particles, is more abstract. Virtual particles are called virtual because they only have consequence for that which creates them (emits them) and that which absorbs them. If they had their own independent existence they would be normal matter and therefore bound to a different set of rules. In order to create normal matter, for instance, you need to contribute energy on the amount of E = mc², but for virtual particles, which are components exchanged “under the table,” you don’t. What is actually happening when magnets attract or repel each other, as best as we can tell, is an exchange of virtual photons – the same particles that constitute light.
Photons are massless particles but they still have energy in the form of momentum. Quantum mechanics tells us that all particles have wavelength, but the more energy a particle has the shorter its wavelength. Since photons have so little energy (the least of any particle we know of) they have a long wavelength. Another way to say the same thing is that photons’ position is not well defined. A particle’s energy and wavelength also have bearing on how easily their virtual version can be exchanged, and therefore affect the affect the range of the force they represent.
Magnets work by an exchange of photons which never interact with anything in the interceding space . There is a near constant stream of these virtual photons occurring, which is also the same phenomenon responsible for our ability of sight, but that is ironically completely undetectable in situ. No magic or rainbows, and while you can’t hold the magnetism you can feel the effect on the magnet. I hope this explanation wasn’t too technical and abstract for all the juggalos and juggalettes out there, but I promise I’m not lying.