Every electron is, by its nature, a small magnet (see Electron magnetic dipole moment). Ordinarily, the countless electrons in a material are randomly oriented in different directions, leaving no effect on average, but in a magnet the electrons tend to face the same way, so they all pull together, thus creating a strong total magnetic force.
In an unmagnetized material the magnetic dipole moments are randomly aligned:
In a magnetized material the magnetic dipole moments are aligned in parallel and in the same direction:
Imagine for a moment that every magnetic dipole moment is a person in a team. In a magnetized team everyone shares the same vision and pulls in the same direction, working together to achieve the same goal as shown in the following image by Mike Griffiths.