I think it's more of a combination of 1) lower baseline usage by macOS and 2) your swap is guaranteed to be on a fast SSD (1.5+ GB/s read/write).
Also when you buy a budget PC they cut back on everything, while you get roughly the same SoC across the board for Mac (give or take a few cores). There are absolutely horrid CPUs, GPUs, and SSDs still being released today! If you cut your budget too much you can get a slow E-core only CPU with a no name SSD that's barely faster than a HDD.
Hopefully the MacBook Neo puts pressure on manufacturers to do better.
https://discussions.apple.com/thread/255765423?sortBy=rank
Why on Earth do I need a 32 GB PC?!?
Turbo C also worked just fine with 640 KB in MS-DOS, but then again MS-DOS wasn't full of Electron crap.