There are four basic magnet-related categories that every material falls under: diamagnetic, ferromagnetic, antiferromagnetic and paramagnetic. Materials have these properties mainly due to the charges of the nuclei and their electrons in the material, and their arrangements with respect to each other.
Ferromagnetic materials(ferro- comes from the Latin name for iron) are attracted to magnets, and can also become magnetised, either by a magnet or an electric current. Nickel, Iron, and Cobalt fall into this category. However, at cooler temperatures, gadolinium is also ferromagnetic, and at even colder temperatures, most of the lanthanides are also ferromagnetic. Despite what you may have heard about neodymium magnets, they are not pure neodymium. They are actually alloys. Pure neodymium would not be ferromagnetic at room temperature. They cannot be ferromagnetic above certain temperatures, for reasons I will explain later.
Paramagnetic materials are like ferromagnetic materials, but they are not attracted to magnets. It seems to me that the prefix para- indicates that paramagnetism has some of the properties, but not all, of ferromagnetism, which is essentially correct.
Antiferromagnetic materials are materials that are not affected by magnets, unless, of course, you push them with magnets or heat the materials until they become plasmas, in which case the materials cease to be antiferromagnetic and you will still not have achieved the goal of causing antiferromagnetic materials to be affected by magnets, even though the plasmas are affected by magnets.
Finally, diamagnetic materials are repelled by magnets. Glass and water are good examples.
Now why do these materials behave in these ways? At the most basic level, there are atoms and electrons. Electrons are negatively charged while the protons, at the nucleus, are positively charged. There are also neutrons at the nucleus but they have no charge so they don’t really matter. If I remember correctly, all, or most, atoms are like very tiny magnets.
At a slightly higher level, there are domains of atoms. In transition metals, there are a few electrons that are not as tightly bound to the atom as the others, so they float around in the metal like a sea of electrons. This essentially means that atoms in metals can affect the north pole and south pole of the atom. In domains, most of the atoms are pointing the same way, but atoms from two different domains are less likely to be pointing the same way.
In ferromagnetic and paramagnetic materials, when there is a magnetic field, the atoms in the domains all point the same way and are attracted to the magnet. The difference is that in paramagnetic materials, when the magnetic field is taken away, the domains point in different directions again, whereas in ferromagnetic materials the domains can still point the same way, i.e. the material is still magnetic. Antiferromagnetic materials can still have domains, but they never all point the same way. As for diamagnetic materials, I don’t know. I could search Wikipedia, but I like to write from what I’ve read prior to writing the blog post.
Then why do some ferromagnetic materials become paramagnetic or antiferromagnetic above a certain temperature? The answer is that the direction atoms are pointing in can also be affected by heat; thus with too much heat, the domains will no longer point in the same direction, even if the materials is ferromagnetic, essentially demagnetising the magnet. Depending on the material, the temperature at which the material must be at in order to do this is called the Curie point.
That’s most of the basic things you need to know about magnetism itself! Other magnetic phenomena, such as why positively charged particles are repelled from electric currents, are quite complicated. In the example I have given, you need to know about relativity, although I forgot if it was general or special. These phenomena are also quite numerous. You can also search two other types of magnetism: ferrimagnetism and superparamagnetism, but I don’t think I will be able to explain those in a satisfactory manner.