How does the hardware manage to save the current workspace state so efficiently?
When you restart a Mac it is the same as restarting a Windows machine as far as clearing out the contents of RAM. The difference is when you log in the state of all of the running apps is saved when they quit so they open to the same place they were. This is dependent on how well the application is written. Apps where less attention was paid to saving state don't come back to exactly where they were. Apple apps are very good at this so it appears as if they were never quit.