The trick is that USB-C has a pair of pins that identify what type of cable is connected. Different value resistors on the pins identify different types of cables, so the USB-C charger will know that the cable plugged into it is a legacy A to C cable, and not actually connect its VBUS.