Benchmarks are of course just benchmarks, but the single-core performance is better for the M2, and the range-topping M2 is about 2x faster than the i9.
Also, regardless of how something compares, if it is ever memory-bandwidth bound, then faster RAM should help. While most tasks may be CPU or IO bound, AFAIK there can still easily be memory bound tasks in real-world workloads.
I picked the i9-11900k for comparison since I think that was the last one to only support DDR4 (making it "DDR4 era"). Ryzen maybe faster in the DDR4 era though?
I assumed it was housing.