I do not assume that MacOS could be configured like this natively.
In contrast to different OSes, macOS is hierarchical in the way in which that home windows ‘belong’ to an software object. An software is within the ‘foreground’ (e.g. it is the frontmost object, with focus), and it might have zero, a number of home windows open.
If you happen to shut a window, you continue to keep ‘in’ the appliance — even when there aren’t any home windows in any respect.
(Apart from apps that may solely have one window, which do stop on shut.)
Your first picture is flawed, in that every one Safari’s home windows will probably be in entrance of all Finder home windows, if you happen to change to Safari. (You’ll be able to in fact simply click on on one Safari window to convey it ahead.)
Assuming that macOS did/might change to a different software everytime you closed one doc window — there are a lot of situations the place this may be deeply annoying. And when you’ve got different functions open, how is macOS to know which different app you need?
If you wish to change to the Finder, then change to the Finder. If you wish to shut a window inside an software, then do this. There may be Mission Management, the Dock, Command-Tab, the brand new Stage Supervisor, and numerous different methods of managing apps and home windows.
