First off, there is a kernel module, called the DRM, which handles low-level hardware access, such as memory buffer management and memory-mapping virtual memory segments to DMA buffers for AGP hardware, and the inter-process security and locking.
Next, there is the driver for the X server. Because XFree86 was being rewritten from the ground up for version 4.0, it was possible to add in hooks for OpenGL calls into the 2D driver which would handle OpenGL context management. This driver does not directly handle any 3D operations, however; this is offloads to the DRI driver.
The DRI driver (not to be confused with the DRM, as described above) has the task of converting OpenGL commands into hardware-level commands. It is also the DRI driver which communicates with the DRM to have the commands actually sent to the hardware. Additionally, the client program can dynamically link in the DRI driver directly - so commands don't have to be transmitted through the slow GLX mechanism. For added speed, the DRI driver can communicate with the hardware through memory-mapped I/O (MMIO), as is the normal case for AGP-based graphics cards.
As far as the client program is concerned, all of this is coordinated through the OpenGL library, libGL. libGL determines whether it is doing indirect or direct rendering (indirect being where it is displaying on another system). In the case of indirect, it simply opens up a GLX connection to the remote display and begins to shove the OpenGL commands it receives down this pipe, whereas in the case of direct, it queries the X server for the DRI driver and whatever connections to the DRM module that it requires, and proceeds to work its magic.