The magnetic forces are felt by charges in motion. That's true. But what causes a magnet to show magnetic properties? The answer to this question answers the phenomenon you asked.
You know that the source of magnetism is a current- a moving charge. In an atom, there are mainly three sources of magnetism:
- The motion of electrons around the nucleus
- The spin of electrons
- The nuclear spin
The effect of nuclear spin is somewhat negligible when compared with that due to electron spin. So let's avoid that from our discussion.
First, we consider the motion of electrons around the nucleus. You may have heard about the Ampere's hypothesis which states that magnetic field generated by a circular current carrying conductor is identical to that produced by a magnetic dipole.
Hence here, our almost circular motion of electrons around the nucleus is like a circular motion of charge through a wire. This generates a magnetic field, with field pattern similar to a magnetic dipole. But do all the electrons contribute to that? Of course, individually yes, but as a whole, may not. Sometimes the effect of one electron's motion is cancelled by the pairing electron's motion. But the unpaired valence electrons, if present, could contribute to the overall magnetic effects of the atom.
How fast the electron moves, so much large will be the current and hence stronger will be the magnetic field. Hence the motion of electrons and the strength of the magnetic field and hence how strongly they interact with an external field are connected. The better we can state the relationship is by stating that the magnetic moment produced by an electron is proportional to it's orbital angular momentum.
The second is the spin of electrons. The spin of the unpaired electron also contributes to the magnetic property of an atom. So there is also an associated spin magnetic moment that is proportional to the spin angular momentum of the electron. This also add up to the magnetic effect of the atom.
In short, due to these effects, an atom with unpaired electrons will behave like short magnetic dipoles. This way, we classify materials into diamagnetic, paramagnetic and ferromagnetic.
In diamagnetic materials, all electrons are paired. Hence there is almost no magnetization of the material in the absence of an external field and in the presence of an external magnetic field, these materials generate magnetic effects that try to oppose the applied field, thereby repelling the applying field lines. These materials are strongly repelled to the external magnetic field. All materials are diamagnetic to some extend. A perfect diamagnet is a superconductor below it's transition temperature.
In certain materials with unpaired electrons, there is individual magnetic moments due each atom. But in the absence of an external field, due to random alignment of these dipoles, there is in effect no magnetism exhibited by such materials in the absence of an external magnetic field. Such materials are called paramagnetic. These materials are weakly attracted to an external magnetic field. Examples include magnesium, molybdenum, lithium, and tantalum.
In certain materials, the magnetic moments of the individual dipoles interact each other strongly so that they form a colony of magnetic dipoles oriented in a particular fashion. These regions are called domains. These materials show a spontaneous magnetization, even in the absence of an external field. In the presence of an external magnetic field, these materials are strongly attracted to the field. Such materials are called ferromagnetic. Iron, nickel, and cobalt are examples of ferromagnetic materials.
When you bring near these materials a magnet, they show any of the above mentioned magnetic phenomena, depending upon the magnetic property it exhibits. For example, iron is ferromagnetic. Hence if you bring a magnet close to iron, it shows a great attraction.