How does the network card determine the cable length?
Many network PHY chips can measure the flight time of a pulse. When a sent pulse is reflected back at the open end and the echo arrives back, the time it took can be used as an approximate estimate of the cable length.
It is called TDR for Time Domain Reflectometry.