The feature is called Tab Unloading, and weirdly enough they made it not easy to access despite its usefulness.
You basically have to type about:unloads
in the address bar and hit enter. If you then click on “Unload”, it will put the least used tabs to sleep. If you keep clicking that button until it’s greyed out, you’ll have unloaded all your tabs from memory.
This feature is handy if you want to temporarily switch to something that is memory hungry without having to close your 100 tabs.
Your OS can’t decide when a tab is inactive though, given that they can run code, play media, etc. at arbitrary times.
Firefox can’t either, because pretty much any page today will have JavaScript running.
The only way it works is to force tabs that haven’t been opened in some time to unload regardless of activity… but that’s something that the vast majority of users would not appreciate. For power users there are a ton of “tab unloader” add-ons that do this.
maybe @Eggymatrix ment swapping.
The OS tracks which memory-pages are used least and will swap them out when active programs need more ram than available.