I'll give you the short version for free.
When a request is made, MODX looks for the Resource specified in the URL in the DB. If it finds it, it gets the ID of the Resource's template from the 'template' field of the Resource's DB record and loads the Template (if it can find it). If a publish or unpublish date has been set, and it's time to act on it, MODX publishes or unpublishes the Resource.
Then, MODX parses all the MODX tags in the Template and replaces them with the result from each.
Some examples:
- A resource field tag is replaced with that field from the Resource's DB record (e.g., pagetitle, content, longtitle, etc.).
- A chunk tag is replaced with the content of the chunk.
- A snippet tag is replaced with the return value of the snippet.
- A TV tag is replaced with the value of the TV for the Resource.
At various points during this process, MODX fires system events (e.g., OnWebPageInit, OnWebPagePrerender,OnOnWebPageComplete). Plugins can be attached (set to "listen for") one or more events. When the event fires, the plugin code executes. The plugin code can alter the page content or perform any other operations (like sending an email, or deleting a file -- anything you can do in PHP).
When all this is done, MODX returns the finished web page to the browser.