In addition to the above; Windows and application instances are not the same thing on macOS. By default the Finder cannot be closed because as stated above, it is also the program running the desktop. But in general, closing all windows is not the same as closing an app. CMD+Q quits an application. The application can be running and in focus even with no windows