On both macOS and Linux, process scheduling goes further than just niceness. On macOS in particular, it has a concept of process priorities[1] and I/O policies, and the OS itself defines special priorities and policies for background processes.
[1] https://www.manpagez.com/man/2/setpriority/