Well, let me simplify it for you. M chips are much much much larger than Intel's desktop chips. That's why a Mac with M2 ultra costs a whooping 3.999$. Way more transistors, way more expensive.
For comparison, the M2 ultra has over 110b transistors and it barely beats the 3 year old 12900k in gb6. The 12900k is literally 1/10th the size.
Now with that said the M2 ultra is much more than just a cpu, since it has accelerators and a gpu, but so does the 12900k, since it has avx and a gpu.
So direct comparisons are silly, but if you wanna make them regardless - the ultra variation of the m4 will be a lot slower than any intel or amd cpu that packs the same amount of transistors in pure cpu performance. It really won't even be competitive, a 52 core xeon or the equivalent threadripper will dwarf the m4 ultra in cpu performance.