It is hard for those who never used text-mode interfaces to understand that graphical user interfaces are kind of 'modern'. In order to make windows and images and so on, there is a subsystem that provides all of the services necessary to do so. That way, application software doesn't have to know how to do it; it just has to know how to tell some other layer to do it. That other layer is X, or colloquially, X-Windows. It is all very standard and portable, so Unix/Linux applications use it. MS-Windows has a similar layer, although it is much more tightly coupled with the rest of the OS, and can't be de-coupled. Linux can run just fine in text mode, even headlessly.
X can run as a stand-alone layer, providing only it's GUI services. In fact, this was the primary model in the early years of X. X-terminals with network attachments replaced dumb text terminals with serial interfaces. The bright people at X-Free86 realized that PC's had all of the machinery to make X terminals, and created what has now become X.org There are X servers that also run on Windows hosts, allowing applications running on remote hosts to display 'the pointy clicky stuff' (TPCS [tm]) on the Windows desktop. X isn't really part of Linux, although these days it is hard to imagine using Linux on the desktop without X.