This is basically a regular grid-tie PV system that has batteries added and circuitry such that it can operate independent of the electric grid. The most famous is the PowerWall from Tesla but there are other manufactures of systems such as this including BYD.
It is easiest to think of this just like the regular grid-tie system with the addition of a local battery and the added function of the controller that it can disconnect itself from the electric grid if the grid fails. Thus, while designed to normally be connected to an operating electric grid it can safely operate independently as well.
Tesla has negotiated with some electric utilities such that end users can program their system to buy electricity from the grid when it is least expensive and sell energy back when it is most expensive. This benefits both the utility and the consumer as producing energy to handle peak load tends to cost the utilities much more than handling the base load.