An iPad Air2 is capable of update to iPadOS 15.8 - does not support iPadOS 16.x or later. By contrast the iPad6 is the oldest model of iPad capable of update to iPadOS 17.x.
iPadOS 17.1.2 is current. As such, the iPad Air2 is already a bad choice. While Apple does not pre-announce end of support, the iPad6 is perhaps a candidate for loosing support at the end of the iPadOS 17.x lifecycle (est. September 2024).
For information, here is a list of the highest version of iOS supported by the older models of iPad (for simplicity - “generations” are shortened to a number) that are restricted in their ability to be updated:
32-bit devices (obsolete)
iPad1 - iOS 5.1.1
iPad2, iPad3 and iPad mini1 - iOS 9.3.5 (WiFi Only models), iOS 9.3.6 (WiFi & Cellular)
iPad4 - iOS 10.3.3 (WiFi Only), iOS 10.3.4 (WiFi & Cellular)
64-bit devices
iPad Air1, iPad mini2 and iPad mini3 - iOS 12.5.7
iPad Air2, iPad mini4 - iPadOS 15.8
iPad5, iPad Pro (9.7"/12.9" first generation) - iPadOS 16.7.2
Newer models are all able to be updated to the current version - iPadOS 17.1.2
- iPad Pro 12.9" (2nd generation and later)
- iPad Pro 11" (1st generation and later)
- iPad Pro 10.5"
- iPad Air (3rd generation and later)
- iPad (6th generation and later)
- iPad mini (5th generation and later)