A Linux system is assembled from several parts that aren't all that related to each other beyond the API interfaces exposed/used
The Linux kernel brings a lot of core OS functionality, including display hardware handling, and a framework to expand that with hardware-specific drivers
The kernel does not bring a GUI framework. That has to come separately. X and Wayland are both approaches to filling that gap on Linux systems
X is basically how GUIs have worked on most Linux/Unix systems for the last few decades. There's some weird cruft from the assumptions used when the X framework was designed
Wayland is trying to get rid of the cruft and align better to how computers are used today. But it has to fight against X's inertia, and it's been a long road to Wayland being "daily driver" usable