Magnet
A permanent magnet is an object made from a material that is magnetized and creates its own persistent magnetic field. An everyday example is a refrigerator magnet used to hold notes on a refrigerator door. Materials that can be magnetized, which are also the ones that are strongly attracted to a magnet, are called ferromagnetic (or ferrimagnetic). These include the elements iron, nickel and cobalt, some alloys of rare-earth metals, and some naturally occurring minerals such as lodestone. Although ferromagnetic (and ferrimagnetic) materials are the only ones attracted to a magnet strongly enough to be commonly considered magnetic, all other substances respond weakly to a magnetic field, by one of several other types of magnetism.
Rare-earth magnet
Second, atoms of rare-earth elements can have high magnetic moments because their orbital electron structure contains many unpaired electrons, in contrast to other elements, in which almost all of the electrons exist in pairs with opposite spins, so their magnetic fields cancel out. This is a consequence of incomplete filling of the f-shell, which can contain up to 7 unpaired electrons. In a magnet it is the unpaired electrons, aligned so they spin in the same direction, which generate the magnetic field. This gives the materials high remanence (saturation magnetization "J"). The maximal energy density "BH" is proportional to "J", so these materials have the potential for storing large amounts of magnetic energy. The magnetic energy product "BH" of neodymium magnets is about 18 times greater than "ordinary" magnets by volume. This allows rare-earth magnets to be smaller than other magnets with the same field strength.