It's easy to understand this, once you realize that window management is app-centric and is organized by Application rather than individual windows but that's a subtle distinction most normal users will not understand on their own.
To compound things, for some apps,closing the window will actually quit the app. And for some, closing the window leaves the app still running in the dock but clicking the dock icon doesn't bring up.
Those few inconsistencies suck, though. Bad apps, what are you going to do? Well, you could reject them from a store...
If it wasn't for Windows confusing people by conflating windows with applications, I suspect most people's mothers wouldn't have a problem with it.
EDIT: And if you're savvy, you can always manage memory manually and quit from the top menu or from the Dock.