Not a tech freak, but the way I had it explained to me is:
Resin is comprised of very small plastic resin beads. The surface of the beads has minute indentations which exactly match the shape of the molecules of contamination dissolved in the water. The resin is more 'attractive' than water so the molecules attach themselves to the resin beads, thereby purifying the water.