Off-grid solar system design
The batteries don't charge and discharge at the same time. If they were charging and discharging at the same time, the current would be flowing both ways on the same wire at the same time, which doesn't make sense.

The batteries make up the difference between the power the inverter wants and the power the charge controller is providing. When it's very sunny, the extra power available charges the batteries. When it's less sunny, the batteries make up the extra power needed. When it's not sunny, all the power comes from the batteries.