I have the Fairphone 5, for which they picked the IoT equivalent of the mobile chipset so they could ensure 10 years of driver availability from the vendor (8 years of majors + 2 of security patching IIRC).
Fairphone 2 came out in December 2015 and saw the last release in March 2023. That's 8 years of software updates when Android devices from that era barely got 3, and you had to pick the flagship.
Kernel updates used to be bound to Android versions because of how the kernel modules development was handled, not really limited by the company or the hardware. I owned a OnePlus 5 and the custom ROM was stuck with older kernels for a while too, until the community stepped up to port it, because there just wasn't an easy way to build kernels with updated custom vendor modules for the hardware. Google addressed at least that part thanks to the Kernel Module Interface (read e.g. https://arstechnica.com/gadgets/2021/09/android-to-take-an-u... ). So newer kernels may still lag a bit based on the manpower available and priorities, but they should be easier to do.
Now that replacement cycles have become longer because hardware is good enough that you don't need to change phone every year, and Android supports KMI and other features that make maintenance easier, more vendors decided to extend support, so at least there's some more choice.
From the environment point of view, I can now finally easily repair my phone. A friend of mine always had bad luck with pixels, so bad that he went through 4 phones in ~5 years (2 bought, 2 replacements). I am at my third phone in 12 years (OP1, OP5, Fairphone).