GrapheneOS is a hardened version of Android, focused on creating the most secure mobile operating system in existence. Currently it’s AOSP Android with modifications made by Daniel Micay, mostly from his old Android Hardening project and new stuff he’s working on, but eventually I believe he intends to replace Android entirely because of security concerns with the Android/Linux kernel.
LineageOS is a project that tries to bring modern-ish mostly-AOSP Android to apparently as many devices as possible. So it has pretty high compatibility as far as custom ROMs go, as long as somebody is maintaining builds for your device. Because it isn’t bundled with Google apps by default, with F-Droid and some research you could create an entirely (or mostly) free and privacy-respecting phone easily on LOS.
Where LOS falls short is security, because LOS has no special security related modifications included. In fact, LOS builds commonly don’t even include security patches for the firmware/hardware they’re running on, even when those patches are available. For example, despite security patches for Pixel devices being open and available, I don’t believe they’re implemented in LOS. Rather, LOS merely implements the AOSP security updates released by Google and uses that patch level. This is highly contrary to user expectations, because LOS is setting their patch level to be very recent, but only selectively including patches that are non-hardware specific, so in terms of them claiming they’re completely up to date security-wise, it’s almost false advertising.
If you need a secure and private device, and you want Android, you should be purchasing a Google Pixel and installing GrapheneOS, hands down.
If your only concern is not having Google stuff on your phone, LineageOS is probably fine.
That’s my understanding of everything at least. Maybe @blacklight447 or @JollyRoger will have something to add.

