Only a few materials found in nature – iron, nickel, cobalt and gadolinium – are ferromagnetic, meaning they exhibit a strong response to a magnetic field by aligning with it.
All materials, however, experience some sort of reaction to magnetic fields, though the reaction may be so slight that it is imperceptible to the human eye.
The reaction comes from the presence of electrons – negatively charged particles – in atoms. These electrons react to an external magnetic field, orienting toward one direction or the opposite. This orientation is known as magnetic moment.
Unlike ferromagnetic materials, which retain their alignment even after they leave the external magnetic field, in paramagnetic materials electrons return to their original orientations once the external field is removed, some pointing one way, some the other.
In diamagnetism, another magnetic phenomenon, electrons within a substance respond to the outside magnetic field by, essentially, spinning faster.
All this spinning generates magnetic forces that resist the outside field. Because all atoms possess electrons, all materials are diamagnetic to some degree. But if present, the stronger forces of paramagnetism or ferromagnetism will easily overshadow the diamagnetism.
Here we see an example of a paramagnetic and diamagnetic material responding to a strong magnetic field.