A laptop can sustain desktop-like performance for short periods (tens of seconds) before they must throttle back because of heat limits. For sustained maximum performance you need the ability to dissipate lots of power for extended periods.
A laptop that can dissipate 50w is naturally going to have close to half the performance of a desktop expelling double that. For the most part, there is no technical differences between a laptop and a desktop processor other than the TDP target.
For most applications, though, this difference is irrelevant. You need to be doing something computationally expensive for an extended (10+ seconds) period for a desktop to be a sensible choice for performance reasons.
For things that fully use a 9950X (i.e. which include a lot of array operations or of operations with big numbers), the throughput of a 9950X in many times higher than of any M4.
A 9950X is not really optimal for a personal computer. The ideal configuration is to have both a mini-PC or a laptop that you use as your personal computer, because even for professional use most of the time you do only things that require very little CPU power, e.g. reading or editing documents, together with a desktop computer with a 9950X that you use as a server, launching on it any compute-intensive tasks.
M4 has almost 5x the memory bandwidth of top of the line DDD5 memory when paired with 9950x.
If Apple was selling standalone processors compatible with Linux they would sell like hot bread.