Magnetic trapping is created by adding a spatially varying magnetic quadrupole field to the red detuned optical field needed for laser cooling. This causes a Zeeman shift in the magnetic-sensitive m levels, which increases with the radial distance from the center of the trap. Because of this, as an atom moves away from the center of the trap, the atomic resonance is shifted closer to the frequency of the laser light, and the atom becomes more likely to get a photon kick towards the center of the trap.
The direction of the kick is given by the polarization of the light, which is either left or right handed circular, giving different interactions with the different m levels. The correct polarizations are used so that photons moving towards the center of the trap will be on resonance with the correct shifted atomic energy level, always driving the atom towards the center.