The cables have an ID chip in them that will specify their rating as to amps and voltage, plus a few other things. If you read my USB-PD story linked above, you will get the details. In short both ends start at the USB base and negotiate up their capabilities for voltage and amperage for send, receive, or both. They will do this within the bounds of the cable connecting them, and while both sides have limited capabilities to sense the cable properties, they really depend on the USB-PD ID chip.
This ID chip is of course counterfeit-proof, something we know that low end manufacturers are not capable of cloning or getting around in, oh, say, 12 seconds. So in short DO NOT BUY CHEAP/NO-NAME USB-PD CABLES FROM EVEN A POSSIBLY QUESTIONABLE SOURCE. Amazon, I am looking at you. Really. 100W = big fire quickly.
-Charlie