Fed played in 65 consecutive slams and was pretty much injury free through all of that, during that time he racked up won 17 slams including many from 03-07 when the era was quite weak and Nadal was only good on clay.
Nadal has missed slams left and right, had injuries and surgeries left and right and still racked up 14 slams by the age of 27.
If Nadal could have played 65 consecutive slams relatively injury free until the age of 34, he wins at least 18-19 slams with Fed a few back. Obviously ifs and buts but even though Fed has 18, he's underachieved and should have won more but choked in big moments, especially against Joker