Here's a simplified diagram which shows how phase-detection AF works. The sensor combines an image formed by the left side of the lens (colour-coded blue) and one from the right side (colour-coded red). From the overlap of the images and their relative position, the sensor can tell how far the subject is out of focus and whether its in a 'back focus' or a 'front focus' position. In other words, it knows which direction to move the focus, and how far.
Contrast AF systems use the image formed on the sensor itself. They offer more flexibility (more AF points, face-detection), but they're slower, which is why Sony has gone to the effort of including a fixed, translucent mirror in its a33 and a55 D-SLRs, so that the phase-detection AF sensor can be active all the time.