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.
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.