To achieve this, SLR cameras have traditionally used part of the camera's primary mirror (plus additional mirrors) to bounce a portion of the light onto a stand-alone autofocus sensor. As a result, phase detection usually can't function with the mirror raised, which means that it's disabled during live-view shooting or video recording.
This is the primary focusing system used in most SLR cameras (both film and digital) and generally has been regarded as superior to contrast-detection autofocus because of its speed and ability to predictively track an object. (More on that trick in a bit.)
By comparison, contrast detection works on a simple measurement of the contrast between adjacent pixels. The camera focuses and looks at a histogram, refocuses and evaluates the histogram again.
If contrast increases, the image is more in focus. If it decreases, it's less in focus. The camera then refocuses and tries again. This is the cause of the back and forth "seeking" or "hunting" many people experience when focusing, and it happens more in low light because there's not enough light available for the sensor to judge if contrast is improving or not.
One of the strengths of the contrast-detect focus system is that it can be performed using the same sensor that's capturing the image, making it cheaper to implement and requiring less space than phase-detection systems, which have traditionally relied on a secondary autofocus-specific sensor.
Even cameras that use phase-detection autofocus will fall over to contrast detection if there's not enough light to perform phase-detect focus, and it's the speed discrepancy between the two systems perceived when this happens that leads many to the conclusion that contrast detection is slow. Because for most implementations in SLR cameras, when the focus speed slows down, it's doing so because the camera has shifted to contrast detection.
Part of the sluggish performance of contrast-detect autofocus in SLRs is based on the relative heaviness of SLR lenses. Since the camera has to adjust the focus of the lens multiple times to evaluate the focus, the mass of the lens and the power of the focus motor have a huge effect. A more expensive lens with a more powerful motor will focus more quickly on a given camera than a cheaper lens with a less powerful motor will perform.