Apple does restrict access to much of their platform for only Apple-based access. There's exactly one company stopping Google or anyone else from building a compatible car system that runs for both Android and ios, and that's Apple. The use of private APIs and preventing competitors from using them, to secure another market (car infotainment systems) certainly should run afoul of anticompetitive laws in spirit, even if it doesn't to the army of lobbyists and lawyers the most valuable company in the world can muster.
By comparison, nothing (not even Google) is stopping Apple from producing CarPlay for Android. All the APIs are there. They could even distribute it in the Play store.
Compare the PhoneLink capabilities between iPhone and Android, vs the macOS integration Apple offers iOS.