One of the true strengths of macOS and its unsung advantages is being built on a true UNIX foundation. Web Developers that use Macs (properly) learn to appreciate this.
I think Windows has something similar with WSL, and it's very easy to install. No science degree required, no compromises or crashes.
I do like the Unix foundation of MacOS - apart from web development, it makes it a nice environment for a spot of coding and scripting (esp. if you use Linux as well and are familiar with 'bash' etc.) or even non-GUI stuff in. C/C++ - I've got stuff that will compile for MacOS or Rasperry Pi with substantially the same source code (although you do run into those annoying BSD/Posix vs. GNU differences...)
Also, for web development it helps that HFS/APFS is a Unix-like filesystem, and now with APFS its a doddle to create a case-sensitive volume for better compatibility.
That said, using a Linux VM with the same Linux distro and UID/GID setup as your target server is rapidly becoming the best way of doing things - and you can do that with either Windows or MacOS. Plus, Linux containerisation is becoming more and more important/useful, which usually means starting with a Linux VM, whatever the host OS.
It's not without compromises, at first it looks great, but if you need something more complicated, you'll find out that it's not a fully functioning linux, like no systemd,
Well, that's also true of MacOS - which
is a "fully functioning Unix", but
isn't a fully functioning Debian/Ubuntu/Red Hat/whatever Linux distro.
NB: Bizarro pedantry time:
MacOS is Unix -
they've got Open Group certification to prove it -
Linux isn't Unix - probably because "Linux" is technically just a kernel (shared with Android, for example) not an operating system, so all the Linux distribution makers would have to certify
their version separately (I guess by the time Red Hat et. al. got big enough to afford it, Linux didn't need the affirmation...) Plus, of course, most Linux distributions depend on the GNU tools which actually stand's for "GNU is Not Unix".