Direct control over Real and Reactive charge/discharge in a battery/inverter AC system
This is a very interesting question, and I'd like to do my best to explain.
When I learnt power systems in Uni, we spent a fair amount of time talking about motors and generators. Let's treat the batteries as a motor/generator.

When the batteries are hooked up to the distribution grid, they can do two things: 


Generate Power (Generator)
Consume Power (Motor)


Ultimately the distribution grid wants to supply all real power (power factor of 1). But not all loads are pure resistors, as we know there are inductors and capacitors in many electronics. 

Therefore, the generators are trying to maintain the grid at a power factor of 1 by varying the amount of reactive power generated or consumed.

This means that at one time, a generator could be either producing OR consuming reactive power in order to maintain a power factor of 1 on the grid (approximately, it is very hard to stay at exactly 1).

For the ESS, there would be a charge controller or inverter/charger interacting with the grid. This unit would be responsible for adjusting the power factor of the overall generating battery system. The same would need to occur in the event of charging the batteries.

Hope this helps!