As kids we were fascinated seeing magnets and its property of attracting iron towards it. We always had these questions in our mind - Why does iron get attracted by the magnet, unlike other materials such as wood or plastic? What is so strange about iron? To find the answer, we have to understand a bit about magnetic properties of materials.
We all know that each element in this world is made up of atoms, which have electrons moving around its nucleus. And this moving electron produces a magnetic field around it according to the direction of its spin, similar to how a charged sphere creates a magnetic field in a particular direction during its spin. So each and every electron acts as a tiny magnet. When such electrons are paired, they spin in opposite directions and the magnetic field thus generated cancels out. If they are unpaired, each electron can act as a tiny magnet.
In metals like iron and cobalt, the magnetic field developed by atoms is very high because of domains. Domains are a group of huge number of atoms having magnetic fields in the same direction. Though such domains on the whole may have different directions, it is easy to change the direction of the magnetic fields of the constituent atoms. It is similar to having many groups of like minded people together already and all you have to do is show them the right direction. That work is done by the external magnet here. So the whole material acts as a big magnet. And when we remove the external magnetic field suddenly, domains will not return to their original position and will stay in same direction. These types of materials are known as ferromagnetic materials and this nature is known as ferromagnetism.
All magnets are made up of ferromagnetic materials because these materials can be converted into permanent magnets easily. Iron can also be converted into permanent magnet this way, although the magnetic property can be removed by applying high mechanical force or subjecting the material to very high temperature, which forces the domain to orient in random directions.
So the next time you look at a magnet sticking on your fridge, you know the science behind it!