I wish there was a requirement that USB C cables must have sort of ID chip that can be easily read that tells what the cable supports, so that we could have simple testers that you can plug a cable into and be told what speed and power it supports.
That exists. It's called an e-marker and you can buy testers for about $60 that will read it for you. If a cable doesn't have one of those markers then odds are it can't handle over 5 amps or USB 2.0 speeds.
It is kind of annoying that that functionality isn't built into phones and PCs though. There was some talk about building support into the Linux kernel[1] but it doesn't seem like that went anywhere.
Except for power, that is all determinable from the cable itself. USB-C cable supports power and USB2 data. Resistor determines the power, either legacy USB, 1.5A or 3A. Every USB-C cables support that. If there are USB3 pins connected, then it supports USB3 data and alternate mode. I think USB3 has negotiation protocol to figure out the data rate. There is also negotiation about power delivery on USB-C specific pins.