Apple builds various precautions into its operating systems that are intended to make the IT life of its users a little more secure. With macOS Ventura, there is an additional security prompt when you connect USB-C accessories to your MacBook if it has an Apple chip.
The accessory must ask for permission separately to communicate with the laptop. This does not apply to displays, chargers, or connections to a trusted hub. Everyone else has to ask, otherwise, no data can be transferred. If you deny the communication, the laptop will still be charged, only the data stream will be prohibited. The user has full control over these settings.
The following paragraph can be found in the Ventura release notes:
For Mac portable computers with an Apple chip, new USB and Thunderbolt accessories require user approval before the accessory can communicate with macOS for connections wired directly to the USB-C port. This does not include power adapters, standalone displays, or connections to an approved hub. Devices can still be charged if you choose Don’t Allow.
You can change the security configuration under System Preferences > Security & Privacy > Security. The initial configuration is to Ask for new accessories. Configuring an access switch control sets the policy to always allow the use of an accessory. Approved devices can connect to a locked Mac for up to three days.
Accessories connected during software updates from previous versions of macOS are automatically allowed. New accessories plugged in before the Mac restarts may be listed and will work, but will not be saved until plugged into an unlocked Mac and explicitly allowed. (43338666)