I haven’t used non apple earphones for awhile but the seamless connectivity performance of AirPods would suggest this was done for performance, not to deliberately lock in devices.
This 2020 paper is great at breaking down some of the extensions: https://www.usenix.org/system/files/woot20-paper-heinze.pdf
In their defence, they went with Lightning shortly before the USB-C spec was finalized. Then, to avoid their customers being screwed over by constantly changing the connector, they kind of had to stick with it for a decade.
People will complain if they push features that are ahead of the spec, and they'll complain if they let the spec be finalized before they use it. Being guided by "What's the best we can do for UX, assuming out users are our users in every product category we enter" seems to be their reasonable middle ground.
In my country (India), Apple still doesn't sell charger and cable along with its new iDevices, even though those gadgets are exorbitantly expensive. And Apple doesn't allow custom repair here, even though my country mandated the Right to Repair, like EU did so. My old Mac Mini 2012 is gathering dust in a cupboard, because Apple service center refused to upgrade it to new RAM and new SATA SSD, citing Apple policies.
Like within minutes, with no big changes?
I didn't think it's rare that a company refuses to do any work on devices they no longer support. Their employees will no longer be trained to do this work, hence they'd have a nontrivial chance of causing damages. That's exactly why a right to repair is so important, so that other people can pick up their slack