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?
Bad design. Drivers are coupled tightly with the kernel, and when component manufacturers stop releasing the binary blob for newer kernels, everyone is fucked. Google could’ve mandated requirements for releasing drivers longer or requiring open source drivers, but they did none of that… so here we are.
Android actually has a HAL that takes care of the old driver problems. Should’ve been implemented everywhere somewhere around Android 9.
The kernel is still an issue, but that’s not going to change. If Google announces Android 14 must not use binary blobs, every phone manufacturer will release their new devices with Android 13 for years to come.