Pump affinity laws allow for the motor to run these calculations in the background. The drive has the pump curve plot points, most likely runs a test at full speed, 3450 rpm, measuring consumed power allows the system to determine flow, which determines pressure. It most likely has lookup tables...