It's hardware for the USB 2 pins (they are just connected through usually). It's software for the USB 3 pins (lanes swap around).
So cheap noncompliant Chinese stuff without a mux for the USB 3 lanes ends up enumerating as USB 2 High Speed in one orientation and USB 3 SuperSpeed in the other.