That is only necessarily true if the strength built is to be tested by free weights. Gymnasts don't train with freee weights much if at all, instead they train the movements with which they display their strength because they train both specific strength and skill. So do rock climbers. If you defined hand strength by closing the No. 4 COC gripper, you'd prioritize grippers over deadlifts. Or if your game was strandpulling, you'd do that. So if the display of strength is identical with the way of building strength, things are simple.
When the way of displaying strength is different from the way it was built, there can be significant disparities, which become more apparent the higher the technical difficulty level is. The average gymnast will do much better at powerlifting than the average powerlifter will at gymnastics for example, with Olympic lifters it will be the same. I just read that "some champion powerlifters" apparently failed to lift the "fullsterkur" stone in Iceland, weighing a mere 154 kg. While stones can be notoriously different in difficulty to lift based on shape etc., I can add that I was toying with blocks of that and weight at work back and loading them onto platforms when I was 22, fairly early in my lifting time, when my best deadlift was a mere 190 kg. So I wasn't nearly as strong as they were on the bar, but it appears I was able to transfer that strength to odd objects relatively well. There's even a stone block in Olympia, weighing 136 kg with the inscription "Bybon, the son of Phola, lifted me over his head with one hand" - and that guy didn't win any of the events (maybe he ran into Milon of Croton or something, which would confirm that the best free weights for wrestling will kick, squirm and possibly occasionally piss on you). So much for the athletes of yesteryear.
If the skill that is tested is even more complex, priorities may shift. If you want to run fast, jump high or far, you'll prioritze jumping and sprinting, and add some resistance training. If the sport demands rapid change of direction, add that on top. If it demands to run far, you run and make sure you are strong enough for that task (but know you have to carry every ounce of bodyweight, muscle or otherwise). And if you want to punch hard, throw hard etc., you'll prioritize punching and throwing practice, and add in some form of resistance training as well - however, we have seen that the choice wasn't always conventional free weights, even now it isn't. Every form of resistance training has its own benefits and drawbacks. Free weights are arguably the form of resistance that can be scaled the best, making progress the simplest, most measureable, that much is true. But if the exercises you can do are too far from your sport in terms of movement patterns or the direction of force is too different, other forms of resistance training can and will take preference, up to and including "sports specific only" in some cases. In light of the examples cited, I would propose the theory that this may work even better the higher the loads occuring during the sport itelf are, because the forces then are high enough to induce a strength-building response.