How do you synchronize to the grid?
The DC to AC converter handles that. A 3 kW converter is about half the size of a suitcase.
Its all controled buy an intertie, which is a charge controler and inverter that is connected to the AC main panel and the electric meter. Batteries or a genset are for backup only.
Excess goes into the grid, deficiencies come from the grid.
They say a picture is worth a thousand words.