The opamp compares the voltage across R16 to the refrence voltage set by the voltage divider R10-R12-P2.
Depending if the voltage across the resistor is lower or higher, the amp output changes the gate voltage on the FET and controls the battery current, so the voltage across the resistor is always held the same.
That means the current is always the same, until the battery has discharged to the point it cannot provide that current.
The battery voltage is monitored separately so the device knows when the battery has discharged to the appropriate end-of-test voltage.
For calibration, the discharge current is set during the device commissioning, by adjusting P2 to gt whatever voltage the designed specified across R16 while the test is in progress.