I have a question that is bugging me for a long time. I will take a BMW E46 (3-Series) as an example so that it's easier to ask.
Comparing M3 and E46 330 engines: S54B32 and M54B30, they are both petrol inline six engines where the M3 engine has a little larger displacement of 3.2L instead of regular 3.0L. However the difference in power output is huge, M54 being ~230HP and S54 ~340HP.
My main question is what makes the difference here? What are other ways to make such a big difference? Both of those engines are n/a, both use VANOS so I have really no other ideas. Is it that M3 has more efficient fuel injectors and pump and better software so that it burns more fuel and uses more air to make this difference? More aggressive camshafts? More efficient exhaust system? All of it combined?