Why are capacitors used in battery chargers
If you look at the rest of the diagram, you will see that the ground symbol is used for all of the circuit blocks.  In other words, the ground symbol is the negative common wire for all of the circuit blocks.

The reason for the input capacitor is to ensure that the chip is stable and doesn't oscillate.  This input capacitor (and the output capacitor) needs to be physically located close to the chip.