There are a couple of ways in which they would be compensated. If you are talking specifically about 'headhunters' (also referred to as Executive Search) then usually they will work on a retained basis, that is, they will charge to go out into the market and produce a short list for the client. This level of service is typically only used at senior levels, so say from salaries of £70k minimum and £100k+ average. The key here is that the headhunter makes a fee regardless of whether they make a placement or not. The big firms like Heidrich & Struggles and Korn Ferry will have no problem charging on a retained basis because of their reputation and the value add they bring to the assignment. They will also likely charge a placement fee of around 30%-40% of first year 'package'. Naturally the recent economic crisis and the falling off of a bridge of hiring has had a massive impact on what they can get away with charging.
Below that salary level, you're more likely to see a traditional recruitment consultancy approach, i.e. working against a brief, sourcing candidates in more traditional ways (i.e. database mining, advertising, networking etc). This type of placement will work more or less only on a placement fee of around 25-35% of first year salary.
The higher the salary of the individual being hired, the more likely you are to see a higher level of value add on the part of the consultant to the assignment, e.g. advising on salary levels, advising on skill/competency requirements, advising on trends, identifying target companies to hire from etc. The more they do this/the more the client wants this, the higher the placement fee.
At the very bottom end you're looking at simple datamining and retail referral mechanisms, as found in high street firms such as Reed and Manpower. This is where the 4% placement fees referenced above come in.
To illustrate the point of fees for Executive Search, some one very close to me recently set up on their own as a headhunter. In their first year, working on relatively senior placements (£100k-£150k) range, they billed £190,000 and made a profit of £145,000. These were audited accounts based on first year trading, where they were active for around 8 months of the year.
We're all in the wrong job!