Comment by sandreas
My personal take is that most Android devices no longer get updates pretty soon after the release (where pretty soon means 2-3 years). Google promises 7 years of support for their newer devices, but most vendors don't.
LineageOS is, besides the fact hat it is more open for non google stuff, providing Android Updates for older devices. While this does not necessarily provide better security (rooted devices are often not considered as secure), you still get the newer Androids security patches and FEATURES. Furthermore you are more open to do what you want.
However LineageOS does to my knowledge not support bootloader re-locking on most devices, which might be a security risk (see https://grapheneos.org/install/web#locking-the-bootloader).
Google promises 7 years of support for their newer devices, but most vendors don't.
Unless you have a Pixel 6 and your security update goes missing?
(Didn't get the July security update and the October update is still missing? https://www.reddit.com/r/GooglePixel/comments/1o2bhur/where_... )