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.