Some apps (Not all) in mac OS have the menu option Save and Close presented together in the File menu. In Windows, they are (Not all apps) placed far from each other, which makes sense to prevent the user from accidentally clicking and closing the file while trying to save it. Why wouldn't mac OS follow this placement?
The question has an error: is mixing Close a file with Exit the application
Close a file and Exit application are two different things. In MacOS the option to exit the application is in the application menu (Excel menu in the screen capture).
On the other side, the Close option in MacOS does not immediately close the file, but opens a window alerting about the action to be performed with the options to cancel, close or save.