One of the benefits of buying a Nexus is that you’re guaranteed prompt updates and security patches, whereas with many Android manufacturers you’re often left waiting for months. Nexus devices are also supported longer term.
Specifically, Google promises at least to years of Android version updates from the device’s launch, and security patches the longer of 3 years from availability or 18 months from when the Google Store last sold the device.