Architeture overview:
User -> display server -> GUI applications -> OS kernel -> hardware.
Based on the picture in Display server.
Loading Details on Timeline
Here we use Linux Mint 19.3 Cinnamon desktop as example.
After system startup (in case you set the runlevel to 5, which means the graphical level), you see the display manager (or login manager) LightDM. You enter your name and password in the text box.
After login, the display manager start display server, X.org server.
A display server connects input devices (keyboard and mouse) and GUI applications and paints output of these applications onto the screen.
Here GUI applications includes desktop environment (such as GNOME, KDE, XFCE) and other "plain" GUI applications (such as GIMP, VLC, etc).
X.org server is the implementation of X Window System, (also called X11 or X). There are other implementations of X11.
X11 is a protocol of display server. A protocol defines how input devices and GUI applications communicate with display server. Besides X11, there are other protocols of display server, for example, Wayland.
See List of display servers for list of protocols and implementations.
After started the X.org server, the display manager started the desktop environment Cinnamon. Then it's process cinnamon-session started a bunch of other processes to provide the functions of a desktop environment. For example, power management, screensaver, sound, wifi, ssh-agent, file manager (nemo), window manager, etc.
The window manager of Cinnamon is muffin.
You can see it via apt list --installed | grep muffin
.
But there is no process contains "muffin" in the output of pstree
.