If the end result is “never having my system freeze up” then it isn’t swapping too aggressively. It is “working properly”.
Apple cop a lot of flack for various things and a lot of it is well deserved. But how macOS handles high memory consumption situations is an example to everyone else in the industry of how to do it in my opinion.
The only time i ever notice my macbook is working hard is when the fan cranks up. Memory can be maxed out and deep into swap and it is still super responsive because it seems to page in advance… so when a new allocation needs to happen, the idle stuff is already paged out and can be ditched from RAM instantly.
this is fortunate, because i would describe apple’s pricing on ram upgrades as being akin to “prison rape” (only tolerated because you’re locked into the ecosystem)… so there is that. but from the software side, it works great.
Also… re: not using swap. Swapping out inactive pages to disk means you can free that RAM up for disk cache for programs actually running. Or be able to instantly fill a memory allocation (larger than available free RAM) rather than trying to juggle memory requirements at that point in time, while the user waits.
I’m pretty sure Apple changed this behaviour around macOS Lion. Because of the new machines being almost all SSD. It made Lion run like shit on old platforms because the disk was getting hammered with pro-active swapping. But if you have/had SSD the new behaviour was an improvement. They tweaked it a bit in Mountain Lion to work better on old machines.