There are a few reasons why your phone or tablet stops getting Android updates. One reason could be that the maker of your device's processor (e.g. Qualcomm or MediaTek) never updated the drivers for newer versions of Android. This is why no phones or tablets with the Snapdragon 800/801 chip ever officially received Android 7.0 Nougat, including the Nexus 5.
Google announced Project Treble a week ago, which aims to solve this particular problem by separating the Android OS from the 'Vendor interface' (the part with all the low-level drivers and binary blobs). The vendor interface under Project Treble is also designed to be forwards-compatible, meaning that it shouldn't have to be updated for every Android update, in theory.
During one of today's Android Fireside Chats at Google I/O, Dave Burke (VP of engineering for Android) revealed that the current Google Pixel and Pixel XL will work with Project Treble. Normally, only phones that ship with Android O will work with Treble, but the Pixel will be an exception.
I'm excited to see if this will give the Pixel a longer support period than previous Nexus devices. Google has only promised two years of software updates (and three years of security patches) for the Pixel. Project Treble could extend that even further - we'll have to wait and see.