Is Mac OS X keeping constant track of my processes?
Simplified explanation: When an application is started, an entry is written to disk that says this app is currently active. When an application quits, that entry is removed. When the system starts and finds entries in this list, it's an indicator that the system crashed or did not shut down properly and it can offer to relaunch those apps for you. It takes virtually no practical overhead at all to track this.

Each application individually may also be tracking which documents you opened pretty much the same way and then reopen your documents when it is being launched. There's no need to "constantly track the state of everything", the system just needs to make a few notes here and there when key events happen (such as an application launching or quitting).