I have a bunch of USB type A to Micro USB type B cables. Some have two outer (pins 1 and 5) longer than the other three pins, for example. And for some cables, the pins are all the same length - and those can only charge my phone. The ones with two longer pins allow data transfer. What's going on here?
Only the outer two pins carry power, the inner two pins are data pins.
It's relatively common on digital interfaces to make the power pins a bit longer than the data pins, to give the electronics on both side of the bus a couple micro- to milliseconds of "warning" before something happens on the data bus.
USB2 hardware is tremendously tolerant in these terms nowadays. There's no causal link between the connectors having proper "forerunning" power pins and data communication possibility, as far as I can tell.