I bet you’re agree that the path’s structure is actually a virtual folder, since MODx processes parent-child connection by ID joins with programming.
When it reads d.html, it’ll crawl its parent-IDs and creates the structure of it.
So I guess, it’s not miracle, just smart.