What happens when I've closed all of an application's windows on OSX?
There is no consensus on whether the app must quit when you close the last window or if the app continues to run, so the decision is left to each developer to decide on an app by app basis. What is true is that quitting an app does release the resources it took - even if some files and code are still stored in RAM or cache until those stores get flushed or used for caching other apps and files at a later time.

Furthermore, there is no restriction prohibiting bad coding, hogging memory, using CPU when no real tasks should be executing, so that as well varies on a case by case basis.

Both Windows and OS X have very good scheduling smarts, paging systems, thread control, etc... and the CPU are all the same in terms of shutting down cores and lowering/raising the frequency based on load to save power and give a "turbo boost" when only one core is executing a single thread.

OS X is starting to let apps signal that they support sudden termination - so that the OS can handle automatic termination, sudden termination and automatic document saving (plus versions) for an app developer. So even if you have told the OS to run a program it can and will decide to "quit" the process so that it won't consume resources while you are doing other things with the computer.

Lastly, with PowerNap on OS X hardware, the line between alseep and awake begins to blur with the system waking partially to perform periodic network tasks which make OS X a bit different than traditional UNIX and Windows in terms of thinking about apps and resource usage.

More reading:


The Core App Design - covers both apps that quit when its window closes and those that do not. Further down, the discussion of termination is fairly readable but also technically detailed
Mountain Lion: About Power Nap - HT5394