Apple certainly doesn't have to do free R&D for third parties. They could, instead, not ship features that work exclusively with other Apple products. Or, hey, there's also the other valid option of "don't be the exclusive gatekeeper of the platform", they're welcome to take that one too.
When Apple goes up against governments over encryption, I'll cheer them on with everyone else. When Apple is engaging in https://en.wikipedia.org/wiki/Tying_(commerce) , I have zero sympathy for them.