It’s actually the native integrations that do this. Android Auto and CarPlay basically act as a display for your phone and little data leaves your device. Connect via Bluetooth to many vehicles and that data syncs to the car’s infotainment.
Whenever I pair my Android phone to e.g. a headset, it asks if I want to share my contacts. And, I suppose, also text messages, and I just checked there's that option with the paired vehicle (and it was unchecked).