This is not true. The recent MacBook Pros are every bit as fast as my Zen 5 desktop for most tasks like compiling.
For GPU there is a difference because both are constrained by thermal and power requirements where the desktop has a big advantage.
For CPU compute, the laptop can actually be faster for single threaded work and comparable for multi threaded work.
Anyone claiming laptop CPUs can’t keep up with desktop CPUs hasn’t been paying attention. The latest laptops are amazing.