The wheel encoders are only used for velocity and position estimation for now. We don’t use them for control. So in ArduPilot (and probably most robotics systems) there are two large parts to the system, one estimates where the vehicle is, the other tries to move the control surfaces, wheels, etc to move the vehicle to where the operator wants it to be.
Re connecting up the wheel encoders, the wheel encoder page only talks about the A and B lines that should be present on the motors. The other lines shown (red, black, green and blue) should be connected to the motor driver (aka ESC). There are tons of different types of motors, ESCs/motor drivers so we don’t attempt to describe how to connect them really.