A good description of the X windowing system is found here:
A quote is here:
http://en.wikipedia.org/wiki/X_Window_SystemX provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. X does not mandate the user interface — individual client programs handle this. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces. X is not an integral part of the operating system; instead, it is built as an additional application layer on top of the operating system kernel.
XFree86 was an implementation of the X11 Windowing system. The XFree project faded away when companies like HP and Sun put resources into the X.org foundation which took over XFree's role as the predominant Linux X11 windowing system.
The drivers are handled in Linux as kernel modules. Modules can be dynamically linked into the kernel at run-time. X11 simply uses these drivers to accomplish its goals as a windowing system.
And as far as why X11 does stuff with Keyboards and mice, etc.. it's probably because making a subsystem of a system covering I/O makes more sense than one dealing with Output and one with Input.
As far as the technically-oriented questions to why DRM doesn't render all graphics I'd refer that to one of the driver developers that float around here.
From my interpretation DRM is a interface to the hardware of the GPU on the system. It is an abstraction to access the hardware of a particular card.
Mesa is like you said a GPL'ed openGL implementation for Linux. Part of mesa's libGL are a set of mesa_DRI drivers that use DRM to provide openGL hardware acceleration so a given application(say tuxracer) can run using GPU acceleration. Without a DRI driver (or DRM) mesa would resort to indirect(CPU-based) rendering which slow.
Mesa exists because it was written for the plethora of 3d cards that are supported with open source drivers.
ATI and Nvidia don't use it in their respective proprietary drivers because, it being licensed under the MIT license, isn't applicable for there models. (I believe that'd be why I am not a lawyer though...) if that isn't the reason then I don't know.
Most of this is from an amatuar's prospective so if any of it is incorrect/misguided don't feel bad correcting it.