I'll add a little to what Stuff and Nonsense said above (all of that correct). Digital data signals travelling though a cable certainly are composed of a rapid sequence of square waves. Two factors affect the quality of the signals at the receiving end - amplitude and distortion. Simple resistance reduces amplitude, but that is negligible in a short cable and is not affected by frequency. However, there is another aspect of this that IS impacted by frequency, and that is the "conductivity" of the dielectric material between the wires. I did a lot of research work decades ago on molecular motions and the major tool we used was measurement of the effective capacitance and conductivity of dielectric materials in a capacitor as a function of frequency of the signal. In fact, the "dielectric constant" of any material is NOT a constant, and this has been well known for maybe a century. At low frequencies it is very nearly constant. But as signal frequency rises what happens is that the molecules of that dielectric begin to absorb energy from that alternating electric field because their normal rate of rotation matches (nearly) the rotation of the field. This causes those molecules to become slightly more excited, but the macroscopic impact on the circuit is that the effective capacitance of the dielectric is reduced, and its conductivity increased. So the capacitor at such a high frequency acts as if its capacitance is lower than we thought, and its conductance is higher. The capacitance change affects the speed of the signal passing though the cable, while the conductance change reduces the signal amplitude. Since the square waves are actually composed of many harmonics of the fundamental signal frequency, the higher-frequency components of the wave are altered more than the lower-frequency ones, and the square wave is no longer square - it is distorted as well as reduced in amplitude. These factors become larger as the signal frequency is raised, so the impact of signal distortion and reduction is much greater as the data transmission rate is raised. In the USB system, the data transmission rate was at 0.48 Gb/s for USB2, and now we have 5, 10 and 20 Gb/s rates in USB3.2, and 40 Gb/s in USB4 and some Thunderbolt systems.
By the way, all of this certainly foretells limits on data rates on wires. In my research days we worked with pure sine waves up to 150 GHz because these molecular motion mechanisms become less important when the molecules simply are not moving that fast. But that also means that trying to send an electrical signal through a wire or even a metal waveguide tube at much higher frequencies becomes more difficult. And remember that 160 GHz is only the fourth harmonic of a signal at 40 GHz.
Back to digital signals. One huge advantage of such signal systems is that they are much less impacted by waveform distortion than analogue systems that depend on clean sine waves. At the receiving end the distorted square wave does not need to be exactly right. The receiver "examines" the wave and decides on only two options. Either it is "ON" if the amplitude is over some value (say, 60% of max voltage) or it is OFF if the signal is lees than, say, 40% of max. (Those two numbers are NOT real - just made up to make the point.) That does leave a small central "Grey Zone" where the decision is not clear, and that means that the receiver WILL make the decision but that might be wrong, and the data is wrong. But in the vast majority of cases of the data is received correctly. Further, the system also uses other error checking techniques to see if the data received makes sense. If it does not, it requests a re-sending of the data to try again. This usually solves the random error problem, but it does slow down the overall data transmission rate. However, that whole process of square wave distortion (both wave shape and amplitude) gets worse at higher frequencies so the demands on cable materials become more important.
What factors are involved? The exact material used for the insulation on the wires is vital - certain types of polymers have more or less absorption of energy due to the motions of their molecules. The presence of small impurities in those materials has a big impact on their conductivity and high-frequency response. The thickness of the insulation on each wire and the resulting impact on spacing of the wires is important. For the average buyer NONE of those can be seen! So we are left with two options. We can rely on the maker or seller to tell us whether or not this cable will perform properly at the required data rate. Or we can look for user reviews and hope most such users are knowledgeable enough to use the cables as intended and give accurate comments. And then we have to hope that a given maker and seller keep on using the same materials and manufacturing processes so that user reviews still are relevant.