Basically X11 lets everything it does talk to everything else it does. There’s minimal isolation and there’s not a clean way to do that in x11 without fundamentally changing how it works and breaking compatibility. There were also other issues to were too messy to solve without breaking things. So it was better to just start over. And now we have Wayland.
One example of this is you could have Firefox and a terminal window up in an x11 environment and Firefox could theoretically see everything you are typing in the terminal window.