I was looking for this answer myself and found that there are two main methods of carpet cleaning - dry and wet. Each with its ups, downs, and price variations.
The dry method works through encapsulation. First, the carpet is thoroughly vacuumed. Then a pre-spray is applied to help break down the dirt. Next comes the encapsulation powder, a substance that looks like sawdust and works like sponges, reacting with the pre-spray to release and absolve the remaining dirt on the carpet. Finally, then the carpet is vacuumed again to finish the cleaning process.
The wet method starts in a similar way, except instead of encapsulation powder the cleaners apply a hot detergent solution to the carpet. Steam cleaning machinery may also be used.
I found all this out while I was looking for professional carpet cleaners in Dorset. Check out Bourne to Clean if you need services in the same region.