It's two different computers with different CPUs, so different runtimes are expected and has nothing to do with the OS.

> Framework laptop running Ubuntu Linux 24.04 (Intel Core i5 CPU)

> Mac laptop running macOS Sequoia (M2 CPU)

Yes, and why? way to not address the question at all.

Are you asking why the M2 is faster than the i5?

Well I was asking whether there is something in the Mac Kernel which makes it faster or is it just the different CPUs/Memory that account for this?

According to general benchmarks Apple Silicon is the highest performing CPU for single-threaded work. It'll be hard to confirm how much of a difference the OS factors in but the hardware difference is most likely why.