The main purpose of the battery is to power the motor. This might sound strange since your cycling is powering the motor. But remember, despite what some brands have you believe, on the road, you don’t generate force in the dead points (pedals vertical). So at those moments the motor needs (a little) power to keep going through your dead point. This is part of the smooth feel. Also, when you freewheel, we need to keep the motor going.
Next to that, the robot has a brain, so we need to keep that going. And if you have a display, that also eats up a lot of energy to power.