It's planned obsolescence. Analog headphones from 15 years will work whereas Airpods will be nigh-unusable after 5 years because the batteries will be spent.
This is completely true but I also just don't really care. The airpods are quite small and use minimal resources so the environmental impact of buying airpods every 5 years is minimal compared to other things. I already do not use a car or public transport so I am well below the average persons resource usage.
And for price, $250AUD every 5 years is well within what I am willing to pay for the convenience of the airpods. I use them daily, I have them in my pocket always. Being able to quickly put them on and take a call and it all just works instantly is worth it to me.
I also have just not ever had in ear headphones ever last that long either. The cable always breaks within a few years max of usage.