How 0.1 capacitor diverts electrical noise on the 5v PWS line to 0V?
You can look at the function of the capacitor two ways:


It provides a very small local "backup" to the power supply to provide power to the chip during transients caused by the chip. This might happen, for example, each time a transistor gate switches from one state to another. These capacitors are usually connected right at the chip and are, therefore, much closer than the power supply which has resistance and some combination of inductance and capacitance on the wiring and PCB traces in between.
The second function is to filter out noise caused by other devices in the circuit. Again this is usually caused by switching in those devices and a high-frequency pulse or noise can appear on the power rails. A small capacitor - typically 100 nF or 0.1 uF as shown in your schematic - is adequate in most cases to shunt the noise to ground while holding the DC steady.


Finally, it's not to protect the 0 V line in particular but to keep the 0 V and 5 V (in this case) line 5 V apart and with minimum noise.