As a point of comparison, Microsoft ships its OS across a variety of manufacturers and largely keeps it maintained across them (give or take some exceptions like enterprise environments & the like).
Even unlocked Android phones purchased independently of carriers have inconsistent lengths of support, so it doesn’t seem to be entirely a result of carriers, so…What happened here?
Like a lot of people already mentioned, it’s because of hardware driver’s mostly. But let’s not forget Microsoft has this figured out mostly already, since pretty much all drivers that have a version for Vista 64bit (2006) works on Windows 11.
Android is catching up a bit though, they split the update process and you now receive security updates almost directly from google since Android 10.