Your battery gets charged from your cycling and discharged from freewheeling, standing still and moving through your dead-point, when your pedals are vertical.
The efficiency of the charging goes up with cadence and goes down with force. The higher the efficiency the more energy gets put in the battery per pedal stroke. So if you climb a lot during your workouts, especially at low rpm, you might actually be taking more out of your battery than you are putting back in due to the lower efficiency of charging. The end result will be that your battery is actually drained despite your hard work.