Because software needs to be aware of the memory lifecycle to avoid losing data when its process gets culled. iOS apps are explicitly built for that, but to my knowledge macOS apps aren't, they are allowed to assume they will run forever until the user closes them.
They are both built upon Darwin, Apple's BSD-based kernel, they are essentially the same OS underneath with different top level API's and even those are getting more uniform with Swift and SwiftUI.