The force that keeps a magnet stuck to the refrigerator is the same force that makes motors turn and induces current in electric generators. Fridge magnets are a household application of the laws of electricity and magnetism.
Atoms contain subatomic particles called electrons, which reside in regions around the nucleus of the atom called orbitals. Electrons have a property called spin, which is analogous to the angular momentum of a rotating object. Since magnetic fields are created by moving electric charges, electrons can create a magnetic field.
Two electrons in the same orbital have opposite spin, so their magnetic fields cancel. Atoms of ferromagnetic materials like iron have unpaired electrons in some of their orbitals; these unpaired electrons create magnetic fields. Ordinarily these fields are oriented at random, so there is no net magnetic field. If the atoms in the iron are lined up by an external magnetic field, however, they will all point the same way, and the iron will become magnetized.
Fridge magnets are made of weakly ferromagnetic ceramics like barium ferrite or strontium ferrite. The magnetic field created by the fridge magnet aligns the spins of unpaired electrons in metal atoms in the fridge in such a way that the magnet and the fridge door are attracted to each other; this force keeps the magnet stuck to the fridge.