The momentum carried by a photon a particle emits, changes depending on where and how fast that particle moves. All particles in a magnet move in the same direction, thus the photons they emit join forces to create a field.
In some metals, when they enter a magnetic field, all their atoms start moving in the same direction. Making them a magnet. Some metals can stay magnetic without external influence. In others, particles quickly start moving in random directions again.
In reality, all things interact with magnets, if their field is strong enough to significantly alter the movement of their atoms. Most things, under the influence of a magnetic field, are repelled. Several materials become attracted.
It depends on the direction of its poles when a material is influenced by a magnetic field and becomes a magnet.