If you buy the parts separately, it's true, they don't interact. If you buy an integrated device, they do interact via a microcontroller that does some logic, depending on the power source.
For backup, they monitor the grid input and put out power steadily, but switch from grid to battery in about 1 cycle if the grid goes wonky (high or low frequency or voltage), then transfer back when the grid gets back to normal.
For self-consumption, they monitor solar panel input (or whatever generation you have) and add or subtract battery power as needed, and potentially switch back to the grid (if there's a grid).
In all cases they avoid energizing parts of the system that don't need to be energized depending on the system state. In particular, they put the inverter on standby when it's not in use.
I see all sorts of horror stories on the web from people buying parts and wiring them together. Seems like the integrated units get more integration testing to help avoid those problems.