The line "f-ing magnets, how do they work?" was coined in 2009 by the hip-hop duo Insane Clown Posse. Magnets aren't really all that mysterious — the basics have been known for two centuries. As a basic component of disk drives, magnets are part of just about every laptop or desktop computer, and they have made their way into tape players and, of course, the things we use to hold stuff on a fridge. Before the advent of flat screens, televisions and monitors were home to some of the most powerful magnets in the average home.

Although the physics of magnets are pretty well-understood (except perhaps by some hip-hop musicians), and they've been part of our lives for centuries, they do surprise and delight. Here's a look at some fascinating facts about magnets.

1. Magnets come in four flavors: Ferromagnets — which include substances like iron and nickel — are composed of atoms with unpaired electrons whose spins are aligned. They make good permanent magnets. In another type of magnet — called ferrimagnets — only some of the electron spins are aligned.

Maglev train starts operation on June 1, 2010. (Image credit: Hung Chung Chih Shutterstock.com)

Most chemical elements, however, are considered paramagnetic, meaning they are magnetized only when inside another magnetic field. Paramagnets also boast unpaired electrons.

If you're looking to levitate objects, diamagnetic materials are the way to go. These materials are magnetized when in a field, but they generate fields opposite to the one in which they are located. Maglev trains work on this principle.

2. Magnetism is light: Why do magnets stick? Magnets attract each other because they exchange photons, or the particles that make up light. But unlike the photons streaming out of a desk lamp or reflecting off of everything you see around you, these photons are virtual, and your eyes (or any particle detector) can't "see" them. They can, however, exchange momentum, and this is why they stick to things or repel them. When a kid throws a dodge ball, they're exchanging momentum with the ball, and the thrower feels a slight push back. Meanwhile the target person feels the force of the ball, and (maybe) gets knocked over — they are "repelled" from the thrower. With photons, the process can also happen in reverse, as though one kid reached out and grabbed the ball while the other was still hanging on to it, which would look like an attractive force.

Photons are the force carriers not only for magnets but also for electrostatic phenomena like static electricity, and it's why electromagnetism is the term we use for effects produced by these phenomena – including light, which is an electromagnetic wave.

3. Magnetism is relativistic: That's right — whenever you turn on an electromagnet and stick it to a fridge, you are demonstrating relativity. Why? According to the theory of special relativity, the distance along the direction of motion gets shorter — that is, a fast-moving car would look squished, even though the person in the car wouldn't notice. That person would see everything around him or her as squished in the direction in which the individual was traveling.

This has consequences for charged particles in wires. Ordinarily, the negatively charged electrons and positively charged protons in a wire cancel each other out. But when current moves through a wire, the electrons are moving. From the point of view of any stationary charged particle outside the wire, the distance between electrons gets smaller. That means it looks like there are more electrons than protons in a given space — all of a sudden there's a net negative charge. Put any positively charged particle (or wire) next to the wire with current in it, and you feel a magnetic force of attraction. Put a negatively charged particle near it and it will repel — and this is why if you run the current in opposite directions through two wires, they will attract each other, and if the current is running in the same direction, they will repel.

A similar thing happens when a charged particle moves through a magnetic field, say, near a (permanent) bar magnet . The particle experiences force. But according to the theory of relativity, you can't say that the particle is moving and the magnet isn't. From the point of view of the particle, the bar magnet is moving. Maxwell's equations, which describe electromagnetic waves and forces, show that you'd see different forces, depending on which reference frame you choose. For a stationary observer it looks like a magnetic force pushing or pulling on the particle, and for a moving one it's an electrostatic force. This problem was a major piece of Einstein's development of special relativity, which accounted for the discrepancy.

4. The world's most powerful magnets: The two biggest magnets reside at Los Alamos National Laboratory in New Mexico and Florida State University (FSU). The two sister laboratories have magnets that can reach 100 and 45 tesla, respectively. By comparison, junkyard magnets — the ones that lift cars — are about 2 tesla.

The 45-tesla hybrid magnet, looking up toward magnet, with detail of coldwater pipes at Florida State University. (Image credit: National High Magnetic Field Laboratory, FSU)

The Los Alamos magnet is designed to generate fields that last only a few seconds, while the FSU magnet can maintain its fields for as long as the power is on. Each magnet is designed to perform different kinds of experiments, noted Ross McDonald, a staff scientist at Los Alamos.

An interesting effect happens with the FSU magnet when there are diamagnetic materials, such as an aluminum canister, around. The diamagnetism creates fields with an opposite orientation to the magnet, so anything made of such materials is stuck in place. "It's like trying to move it through molasses," McDonald said.

It's not safe to play with aluminum canisters near the Los Alamos magnet, for the same reason that it isn't safe to stand in the room in which the magnet is housed. "Every pulsed magnet will eventually destroy itself," McDonald said, because of the stresses of the magnetic forces on the coils. When they fail, they can fail catastrophically. "We have something like 100 sticks of dynamite's worth of energy in there and we contain 99.9 percent of it," he said. But that last percentage point is still a lot, so LANL evacuates the building when its magnet is on.

5. Magnets showed that quantum mechanics worked: The discovery of one of the fundamental quantum mechanical properties of elementary particles — spin — involved magnets. It's called the Stern-Gerlach experiment, after physicists Otto Stern and Walter Gerlach. They conducted the experiment in 1922, to test ideas about the then-new theories of quantum mechanics. They used two magnets, one on top of the other, each shaped to produce a long, asymmetrical magnetic field. They then fired uncharged particles — silver atoms — through the field at a target. The asymmetrical field will alter the silver atoms' trajectory slightly. , Since the atoms will be oriented in random directions and their angular momenta will also be random, the trajectory should be different for each silver atom, but it was not known by how much. The target should have shown a smooth distribution of hits from one end to the other.

That didn't happen. Instead, the experimenters got two clusters of hits, as though the beam had split into two directions with the particles unable to deflect to anywhere in between. Stern and Gerlach had just demonstrated that particle spins were quantized — they can be up or down, but nothing else.

6. Magnets don't have to be iron or even metal: Most of the magnets we use are made of iron (like fridge magnets). But that doesn't have to be so. Magnets can be made of any material with unpaired electrons. That includes many metals and alloys, such as neodymium, which is used in disk drives. Ferrimagnetic materials, in fact, are often not metals at all. Among them are spinels, which are used in the magnets that seal refrigerator doors.

MRI scan. (Image credit: Shutterstock.com)

7. Magnetic medicine: There isn't any evidence that magnets work for pain relief. The reason? Even though there is iron in your blood, it's made up of atoms that are too far apart and too diffuse for magnets to affect them. If you tested this by pricking your finger and spilling blood near a magnet, you'd find that neither your blood nor the magnet would attract one another. [11 Surprising Facts About the Circulatory System]

That said, magnets are used in magnetic resonance imaging machines, which use magnets stronger than the ones in junkyards that lift cars. In most cases MRI magnets are superconducting and cooled with liquid helium.

8. Long known, but not understood: The ancient Greeks and Chinese noticed something was up with certain materials, known as lodestones. Lodestones were actually magnetite, a form of iron oxide that forms when magma cools slowly. The lodestones attracted other ironlike metals, and even better, could magnetize ordinary iron. When small pieces of metal were magnetized, then hung from a string or floated in water, they aligned with the Earth's magnetic field — becoming the first magnetic compasses.

9. Animals sport magnets: Some animals and bacteria have magnetite in their bodies. A type of mollusk called a chiton even has magnetite in its "teeth," which actually cover its tongue. The magnetite is abrasive and lets the animal scrape algae, but it might also provide a homing sense, enabling chitons to find their way back to certain places where they like to mate and feed. Studies of homing pigeons seem to show that they have a magnetic sense that helps them navigate. Magnetite in the animals' beaks seems to be the key, though how big a role that magnetic sense (called magnetoception) plays is unclear.

Follow Live Science @livescience, Facebook & Google+.