The reason that Nadal is winning in the head to head is that the majority of times they have played, it has been on clay (Nadal's best surface, Federers worst), I believe. That is not to say that Nadal can't beat Federer on a surface other than clay - we all know he has - however, Federer leads the non-clay head to head. If you don't believe that argument, then imagine that the majority of matches between Borg and McEnroe had been on clay (a surface they never officially played together on), then Borg would be leading by even a greater margin than Nadal does over Federer.
timnz, with all due respect (and I do mean that), I think you were oversimplifying here. You're right that the surface has a lot to do with the lopsided H2H, but you seem to think it's the only reason. I disagree. IMO another and more important reason is that Nadal is in fact a bad matchup for Federer.
You need to look at their entire rivalry to see why one might think that. Let's recap their first three meetings on a HC:
2004 Miami - Nadal, then a relatively unknown newcomer, knocks out Federer in straight sets. Despite this win Rafa doesn't bag a single HC title the whole year.
2005 Miami - The outcome is reversed this time, but only after Nadal wins the first two sets and Federer barely ekes it out in a tough 5-setter.
2006 Dubai - Nadal wins again, this time on a fast HC that should on paper suit Federer's game more.
Now their three Wimbledon finals:
2006 - A fairly breezy win for Federer, but Nadal manages to grab a set in a TB. Still Rafa fails to reach the final at any of the Masters events he plays that year.
2007 - Federer survives another tough 5-setter. Now Nadal is starting to catch up.
2008 - Thanks in part to an improved serve, this time it's Nadal who's holding the trophy after yet another 5-setter.
As for their three encounters indoors, Federer won the first two comfortably, but Nadal kept it closer the third time around (which, of course, was the last ATP match of this season).
There's a pattern. And even then we're talking about just 10 matches on a variety of surfaces. The only conclusive surface advantage you can gather from the Federer-Nadal H2H alone is Rafa's on clay.
To see how they match up on other surfaces, you need to look beyond the numbers. And my take is that Nadal is a tough matchup for Federer not because Fed's best game cannot neutralize Rafa's, but because Rafa's own game makes it tough for Fed to play his best, largely due to four factors:
1) Nadal is a southpaw. This presents problems for Fed from the get-go because he must receive a serve out wide on the ad court, and as with most one-handers that's where his return of serve tends to be at its weakest. After the serve, Fed must also deal with the fact that one of his specialties, his inside-out FH (particularly from the center), isn't as big a weapon against Nadal as the ball goes straight to Rafa's FH and, on slow surfaces, right at his wheelhouse. And we all know how Rafa has exploited Fed's BH over the years.
Which brings me to 2), the trademark Nadal topspin. In the majority of their cross-court exchanges, Fed's BH must counter Rafa's FH, and the Spaniard's heavy topspin makes the ball kick up high especially (again) on slow surfaces, which in turn makes it hard for a one-hander like Fed to be aggressive with his BH.
3) While Fed has a pretty high shot tolerance himself, Nadal's is even higher. But most of the time Fed is either unwilling or unable to dictate play and keep the number of shots to a minimum--perhaps understandably so because Fed is at heart a baseliner--and for that he has paid the price.
4) Though Fed's mental strength is often underrated (you don't make 23 consecutive SFs at the majors if you're a mental midget), he does have this unfortunate tendency to wilt when his opponent will not budge an inch. (I'm not just talking about Fed against Rafa, BTW. For other examples see his crucial '03 Davis Cup rubber against Hewitt, '09 USO final against del Potro, and '09 Doha SF against Murray). That's a huge no-no against Nadal, one of the fiercest competitors to have ever played the sport.
And let me again emphasize that those early wins by Rafa on HCs came before his prime, when he had yet to play closer to the baseline, flatten out his strokes further, and develop a serve befitting one of the world's top players. In other words, when he had yet to master all surfaces. Tie all these together and it's not hard to see why prime Rafa would've been a tough matchup for prime Fed.
Anyway, that was not the main point of my original post, which was that these skill-by-skill comparisons are often misleading. You should be familiar with this MO: someone wants to hype up his hero, so he draws up a list of skills that he deems important--almost invariably to his player's advantage, of course. And to make his comparison look better he might even incorporate scales (say, of 1 to 10) on which to rate each skill. Then he declares that his hero is superior in more skills, and thus a better player.
Needless to say, tennis doesn't work like that in the real world. The problem with such a cartoonish approach is that it's most likely a case of numerous glaring commissions and omissions: an important stroke like the lob or the drop shot might not even get a mention, while there may be some silly "skills" like ability to apply constant pressure or to hit non-textbook shots though you see other similar (but differently named) categories. (I don't mean to suggest that the skill-set comparisons we have on this thread are as bad as this parody of an example. I just want to caution against taking such comparisons at face value.)
And then you have to factor in the holistic aspects of the game. For most players the serve or the forehand would be a more important stroke than the overhead or the backhand, especially if both or either of the former is a big weapon. You can't tell that from the kind of comparisons outlined above; all you see is which player has a greater number of superior skills, or a greater number of points. And which era are we talking about? The lob would've come in very handy in the golden era of S&Vers, but not so much today. And how do we account for the fact that the 1st-serve percentages have been steadily rising over the last decade or so? Does anyone in his right mind think this is simply because today's players are better servers, when the fundamental mechanics of the serve has changed very little throughout the history of tennis?
Nothing in life is that simple, and certainly not the overall skill set of GOATs or a H2H between two of such advanced and multifaceted players.