Federer is a hard-court specialist, Nadal a clay-court specialist.
3 out of 4 majors are on fast surfaces.
Hence, Fed has more majors.
Nadal will have far more Master's 1000 titles than Fed. Despite being younger and injured all the time, he already has as many. Those are arguably harder to win than Major's anyway, since you compete against a denser field and don't play patsy players in the first 3 rounds.