I'd say both behaviours could be equally surprising to any user, regardless of their previous OS biases but either way that's not really related to the point I was making.
I was just saying that an inexperienced user will notice technical details less (e.g. the ramifications of processes continuing to run in the background without windows, the dock status indicators showing they're still open, the fact they show up in the app switcher, etc.) and as such won't be inclined to "take control" of that default behaviour in a way that an experienced user might, due to their heightened awareness of it.
macOS has those also, programs can live on the menu bar.
But in macOS, closing the last window basically never exits the program. Even for a program like Element, which is just an Electron view, closing the window doesn't quit the program, even though what's left over is useless: there's no way to relaunch the Electron pane except to quit and start it again.
This is just how macOS works: if you want to quit, you type Cmd-Q, if you want to close windows, red button or Cmd-W, and closing windows won't quit your program.
There's plenty (an increasing number, IME) of Windows apps that work that way, but mostly if an app exists to facilitate some kind of user interaction via a UI and there's no worries open there's no reason for it to be open, so no windows = closed app is a fairly same convention.
> Even for a program like Element, which is just an Electron view, closing the window doesn't quit the program, even though what's left over is useless:
I think that last part pretty well illustrates why “closing all windows is not closing the app”, while it make sense in many cases, is not a great model to be applied inflexibly.
I mentioned that Element is just an Electron view because it doesn't behave like a native Mac app. The correct thing to do is to offer a menu item which would bring the view back.
VLC is a good example of an app which works correctly in this way. There's only the one window, which shows either the playlist or the video. If you close it, VLC stays open, and there's a menu item which will bring it back.
Of course VLC can also open files, so Cmd-O is useful here, and Element doesn't happen to support more than one window... because it's a browser view dressed as a Mac app. If it were native, it would be a no-brainer to support multiple windows, each with a given user account.
So yes, there are some edge cases where an application offers exactly one window, and there's no reason to close that window instead of closing the app. But the Mac-native thing to do is to offer a menu item to bring that window back, instead of breaking consistency by having that program just disappear on you when you close the window.
If you open up QuickTime Player and then play back a video, then close the video, as soon as you background the app, it auto-quits itself. I wonder if they made it behave this way at some point to get around a memory leak. It's such an unexpected thing and it infuriates me each time I encounter it.