Use caution when purchasing USB-C cables or adapters: they are not all alike.
Though a USB-C port has been used for charging and data transfer on recent models of iPad, its introduction as the charging and data port for the iPhone 15 family of devices has introduced many users to the somewhat strange world of USB-C cables and adapters, and some confusion has occurred as a result.
The important thing to remember is that USB-C is not a particular type of cable (or adapter), rather it defines a connector size and shape.
Summary:
If you find your iPhone no longer connects to wired CarPlay, or is not seen by your vehicle's entertainment system, your computer or other device when connected to a USB jack using a new USB-C cable or adapter, you may need to purchase a different cable or adapter that specifically supports both charging and data transfer. The cable included with your iPhone does support both charging and data transfer.
Background:
There are a wide variety of different cables and adapters that will connect to the USB-C connector and that will support data transfer at different speeds - as well as some which will only support charging of connected devices.
These latter cables and adapters are known as "charge-only" accessories, and they do not support data transfer at all.
For most such accessories, the only way to tell which functions they support is to check the vendor's specifications on the manufacturer's or seller's website, as their retail packaging often does not mention it.
The exception to this is Thunderbolt 3 and 4 cables, which though they connect to USB-C connectors, are marked with the Thunderbolt logo:
on the sleeve of each connector. These cables are fully compatible with all USB-C functions, including charging and high speed data transfer.
All Apple USB-C cables and adapters, including the cable that came with your iPhone, support both charging and data transfer.
This Apple Support document more fully describes charging and connecting using the USB-C port on the iPhone 15 family of devices:
Charge and connect with the USB-C connector on your iPhone 15 - Apple Support
but it omits any mention of charge-only USB-C cables and adapters.
If your vehicle supports wired CarPlay or you connect your iPhone to your vehicle's entertainment system via a USB jack, you may need to purchase a new USB-C cable or adapter to do so. If you connect your iPhone using a charge-only cable or adapter, your phone will charge, but it will not connect to CarPlay or be seen by your entertainment system as a USB device; instead you must locate and purchase a USB-C cable or adapter rated to both charge your device and pass data.
The same is true when connecting your iPhone to a USB jack on a computer or other device.
According the the USB Implementers Forum, you can tell whether a USB-C cable or adapter is charge-only because the official USB logo cannot be used on charge-only accessories, but most USB-C accessories at present do not carry the USB logo anyway.
Therefore, when purchasing a USB-C cable or adapter, you must investigate whether the accessory is designed to be charge-only or if it supports both charging and data transfer.
This third-party video does a great job of explaining some of the differences between USB-C cables and why Apple's very high quality Thunderbolt 4 cable is more expensive than competitors' cables:
YouTube: Adam Savage's Tested: Why Is Apple's USB-C Cable $130?