It's not technique, only. However, it's also not as mental as many like to say. It's also about having the innate physical attributes that let you anticipate, react to changing variables on the fly (for example seeing something just as the opponent starts to swing or midswing), get into proper position, etc. in order to get that technique into play.
I'll give you a good example. Try returning a 125+ serve. I've done it. Overall, not consistently and hardly consistently well when I do. Now, face the same serve and just try to stop the ball as in just collecting the balls on your side...like in a warmup, drill or something. You can almost always just stop the ball. In fact, most I've seen can do so nice, relaxed and rather easily. For the best of the best like Federer, Nadal, etc., that is what it's like with actual match play balls.... it's just....easy. When they play each other, well, not so much, as we have seen play out in real life. When it comes to all pros, they're all capable of playing at top of the top level but they can't do it consistently like the top of the top. That's why there's upsets and bad days.