The increase in performance goes hand-in-hand with emissions standards because - to some approximation - a more fuel efficient engine is more powerful for the same displacement than one that isn't. CFD is what really drove the last 25 years of improvements in this field, better models of what actually happens in a combustion chamber have helped tremendously in extracting the last bit of performance from the engines. The F1 engines are amazing in this respect, their longevity is terrible but their performance is nothing short of incredible in terms of thermal efficiency (> 50%; long thought to be impossible).
https://autoweek.com/article/formula-one/mercedes-f1-engine-...