Wow, this is a wild one. In short: some unknown individual or group spent years gaining trust and working their way into contributing to code for xz-utils, a collection of tools related to file compression, present in almost all Linux and Unix systems.
If it had been successful it would have given them a perfect backdoor, through SSH, into all Linux/Unix systems, giving them the power to do pretty much anything with those servers. The fact that is was caught at all was the result of a lot of expertise, combined with a whole lot of coincidence and luck. And it was caught just in time: the backdoor hadn't made it to production-ready releases yet, only to the beta versions.
The though part is: there is no real way this can be prevented. The attackers took years, contributed proper open-source code, and really knew their stuff. And what they did would not have been easily detectable by standard EDR systems either, it's that clever. They also made use of the fact that many open-source coders are burnt out, because it's often a damn thankless job to do. You can see the emails where they pressure the original maintainer, stressing him further and pushing him towards "accepting help". It's a long standing problem with open source and there's no easy fix.
There's many more nuances to share. Like the fact that, in the end, the backdoor job was probably rushed, due to an upcoming fix to systemd that would have blocked this particular attack. Or that the backdoor wasn't really in the source code itself, but in the package building systems. The linked article is a good read if you want to dive deeper, although it gets very technical. This post gives a great timeline of all the events, and this post with Kevin Beaumont's take is always worth a read too. We'll be digesting this one for a while, and hopefully learn much from it.