With the example of the 7700X, it has a thermal limit of 95 °C, a power limit of 142 W, and a boost/PBO limit of 5.55 GHz. Whichever hits first will stop the CPU from boosting further. With a 280 mm AIO, I hit the frequency limit of 5.55 GHz in Cinebench single-core, but I hit the power limit of 142 W in multi-core, while the CPU cores work at 91-92 °C max. I never reach 95 °C on it, ever (or maybe I will in the summer, we'll see).
Zen 4 does not boost to 95 °C if your cooler allows it to hit its power target, the same way a 13900K won't boost to 100 °C if it can reach its max boost while staying under the temperature limit. Simple as. The fact that 95 °C on Zen 4 is completely safe is a different story.