If I had to guess, I'd say that the extra wires are for some sort of sensor feedback - likely encoder data, current sensing, or something similar. I suppose there's also a small chance that there's an ESC built into the motor itself, and those wires are for the signal data. In other words, I've got absolutely no idea, and this is a case where documentation is a must

.