Put simply, it has a particular temperature target that it tries to stay at as much as possible and it'll adjust its clockspeed boosting dynamically to achieve that. The more easily it can maintain that temperature, the higher the CPU will boost. With a lesser cooler, this means the chip may barely be boosting at all depending on the cooler's capabilities, especially for hotter chips like the 5800X, 5900X, and 5950X (which interestingly all share the same 105W TDP despite considerably different power consumption characteristics). Depending on how bad the mismatch is between CPU and cooler you may be better off saving money and buying a cheaper CPU with performance closer to what your cooler is capping more expensive CPUs to.
And yes you're right, you're probably not going to get cooling that competent from a major OEM. That's why it's not a great idea for home users to buy from a major Windows PC OEM unless their needs are fairly pedestrian.
I had a Xeon workstation from one of the big name OEMs. Dual socket, each CPU had a TDP of 135W. The fans they shipped it with were rated for 140W. They were essentially their version of that Zalman thing, but with 80mm fans instead of 92mm. The rating was the real limit for what they could handle.
Which worked fine for one 135W CPU, but the sockets were positioned so the hot air from the first socket would blow over the second one. The second CPU would get just over temperature and thermally throttle. So I replaced them both with the Hyper 212 and the temperatures dropped 25 degrees.
What I gather from this is that the smaller one was good for a 135W CPU as long as its inlet temperature wasn't already high and the bigger one was good for it even if it was.
The 5950X has a TDP of 105W and all AM4 boards have one socket.
Do the even more expensive fans cool even better? Probably. And if you're the sort who likes to pay more to have a little slack, do as you like. But it's not what you'll get from an OEM.