These days, it's normal to have a speed sensor inside the motor. In that case, there's a white wire in the motor cable next to the hall sensor wires, and there's a matching white wire in the controller's motor connector to bring the signal into the controller.
Older motors don't have speed sensors in them so you have to use a wheel magnet type for them, which connects to that black, red and white wires connector. In that case, it's quite common that the motor cable doesn't have the white wire in it.
Some of the older versions of the controller weren't expecting the motor to have a speed sensor in it, so they don't have the white wire in the motor connector.
Whichever yo have, motor with or without speed sensor or controller with or without the white wire in the motor connector, there's always a way to connect whichever arrangement you have. If your controller has a white wire in the motor connector and one in a separate connector, both wires are joined together inside the controller, so you can use either or both.
In spite of all that, if a speed sensor isn't connected, the motor will get the speed signal from the normal motor hall sensors, but the display will always show zero speed when freewheeling because the motor won't be turning unless it's a direct drive one.
There's a setting in the controller that tells it what speed sensor you have:
0 = no speed sensor. Controller gets the speed from the halls
1 = one magnet, like wheel magnet sensor and many motors internal speed sensor
6 = 6 magnets for some Bafang motors.
Any other number for any direct drive motor. If you have a 6 magnet motor, it's not unusual for one or more to fall off so you get the wrong speed indicated. In that case you can adjust the settings, and as Neal says, it's quite common for internal sensors to pack up, then you can use a wheel magnet one and set the setting to 1.