The core concept, and what something like url rewrite is doing (although url rewrite is sort of missing the point and should exist as a legacy device - because it acts to map a request not to an action, but to another 'internal request' which then results in an action) is that modern web servers don't purely work on mapping the incoming url path to a local path anymore, they actually initialize a bunch of modules that can listen to all requests coming in (iis7 more so), and a module can then choose to initialize a handler for the request if it thinks it should handle it.. you can also directly bind handlers to urls in the web.config..
This is specifically how IIS works, other web servers may choose a more direct approach to pattern matching urls to 'delegates' yadda yadda.