There should be a standard. (Yes I know the XKCD)
Apple and Android each having their own is ridiculous and actively prevents smaller competitors(one can dream)
For what it’s worth I’ve heard they’re basically identical. It’s just some two-way data and an h264 video stream. There’s a reason basically everyone supports both. Seems to be really easy.
I don’t know whether the auto makers actually forced them to be compatible or it was a choice in Google’s part to get into cars that already had CarPlay.
But it really doesn’t seem like it’s a big hassle. Most of it is probably just certification testing to be allowed to use the names/logos.
My car has wired carplay/android auto, but I have a nifty little USB dongle that receives carplay/android auto wirelessly and passes it to the car via USB. Sometimes called an AI box, I think.
These things contain a whole System-on-a-Chip board. I presume what it's acting like a middle box; pretending to be the headunit to the phone, and then sending the phone's output to the headunit, pretending to be a phone.
Since they need a quite beefy CPU to do that, I'm guessing they don't just pass along packets, but actually speak the protocol on both ends, and perhaps transcode the a/v stream.