https://www.lumafield.com/article/usb-c-cable-charger-head-t...
The device definitely knows, all the information is accessible in the USB info if you know the special tools to run to dump it.
It would seem that with e-markers in USB-C cable (and assuming that USB 3/4 still expose device information like that to the host), an extended version of this should be possible: "Your computer and this device support x Gbps, but your cable caps out at y Gbps; use a better cable to make this connection faster".
Even without an e-marker, there has to be some way to know that the client device can support a higher speed and warn the user - it seems like USB device capabilities supports that?
[https://developer.apple.com/documentation/iokit/1425036-usb_...]
5A already needs a marker, even at USB 2 speeds!
Just a simple information window that lists the max charging Wattage and data transfer speed of the current cable/charger/device configuration would suffice.