How a battery is being charged and used as the same time?
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. A very simplified schematic.


  How a battery is being charged and used as the same time?


It can't. Either current is flowing into the battery (it's being charged) or current is flowing out (it's being discharged). You can't have current flowing both ways in the one wire. 

This is the same as a car electrical system. The alternator charges the battery even though the lights, ignition and radio are switched on. The current into the battery in either case is the difference between the charging current and the load current. The result of the subtraction can be positive or negative with, for example, positive means battery charging and negative being battery discharging.

An example:


V1 is supplying 5 A.
Load is drawing 6 A.
Battery current = 5 - 6 = -1 A. It's discharging.