You are referring to a battery equipped hybrid inverter that accepts AC input from grid or generator.
Hybrid inverter has inverter permanently connected to AC output. There is a connect relay between AC input and inverter. Relay is normally open. When an AC input voltage is detected and within acceptable voltage/frequency range the inverter starts a slow phase tracking adjusment to match the AC input phase. The inverter also is adjusted to match AC input voltage which is the easy part. Once AC phase and voltage of inverter matches AC input the input relay closes putting the inverter in parallel with AC input (grid or generator).
PWM inverter can modify its AC voltage slightly when running in parallel wth grid. If inverter puts out a little more voltage then AC input voltage the inverter pushes out power. If inverter is adjusted to out a little less voltage it sucks power in from AC input for charging batteries.
There is a three way connection node. AC input, AC output, and InverterAC. With current sensing the inverter can manage the AC current flow between the three branch node. This means inverter can totally power loads by itself, suppliment incoming AC input power for output AC loads (load shaving), or even supply loads and push power out backwards into grid (export to grid). It can also suck power from grid or generator to charge battery. AC coupling allows a PV grid tied inverter connected in parallel with hybrid inverter output to push power into AC out to either push power through to grid or through inverter to charge battery. For AC coupling the hybrid inverter acts as as surrogate grid for PV grid tied inverters when grid goes down.
Generator AC must be stable. A common problem with 3600 rpm engine generators is their freq stabilty wobbles because of unstable govenor. Inverter phase tracking is relatively slow so it cannot follow a fast varying AC input frequency/phase. Inverter will just open relay and release from generator when this happens.
Block diagram looks like this. This diagram happens to be for low freq inverter but HF inverter is similar for block diagram.
View attachment 78665