Does the electrical impedance of a headphone depend more on the cable or on the headphone itself?
The impedance of headphones is a function of the headphones themselves, not the cable.

The cable does have a finite resistance, but that is small compared to the impedance of the headphones.  Unless the cable is unusually long or thin, the cable is not a issue.  A few feet of even thin cable should be fine.