The OS can regulate large parts of the performance curves but some of the configuration is in the microcode/firmware AFAIK to allow laptops designed for a certain thermal load to not exceed that load for too long rather than let the CPU fall back on thermal throttling at a less opportune time. I know Lenovo has a Windows driver that will boost performance of the CPU and GPU if you enable performance mode, even going so far as pre-spinning the fans in anticipation of what you're doing.
I'm not sure how the modern system works because CPU performance characteristics have changed quite significantly over the past few years.
Most desktop chips seem to follow very similar Intel/AMD curves anyway, but I know Apple used to aggressively tweak Intel CPUs to boost high very quickly whenever there was an interactive load (opening a program, clicking a link etc.) to help make the system feel responsive despite their terrible cooling solutions. A lot of their chips really couldn't take a load for too long before slowing down drastically, but most work by most people is in bursts so outside of areas like gaming and simulation you probably can't even notice.