It used to be that the main ground for your electrical service was to a "cold water pipe" and that was it.
Then plastic water pipe came along...
Now the electric service ground at a house is typically to two ground rods spaced 6 ft. apart. AND there is a second "ground wire" from the electric service going to the "water pipe system" (if metal pipe) to "bond" it to ground.
And in this case, we are not using the water pipe system as a "ground", rather we are making sure it is "grounded" or electrically connected to those two ground rods (and the neutral) at the electrical service.
And this is done because an electrical malfunction* can "energize" a metal water pipe system. Then grandma goes to brush her teeth in the morning, touches a metal water faucet handle, then gets electrocuted - but NOT if the metal pipes are bonded safely to ground!
*Things like a refrigerator with ice maker, washing machine, dish washer, electric water heater, etc. can have an electrical short to a metal water pipe system. Or a bare electrical wire could be touching a metal pipe somewhere. Etc.
Anyway if ALL of your water piping is plastic, which does not conduct electricity, then of course no need to bond it to ground. However if you are replacing a section of metal pipe with plastic pipe, then the REMAINING metal pipe in the house still needs to be bonded to ground. You can install electrical jumpers from one section of metal pipe past the new plastic section to the remaining metal section.
Or if the new plastic section "dead ends", no metal pipe beyond that, then just move the bonding connection to the metal pipe prior to that.
In some cases you might have...
You would just need to electrically connect all 3 metal sections together and be sure one section was bonded to ground at the electric service.
And water heaters can electrically "isolate" the hot water pipes from the cold via "dielectric unions", so it is common for there to also be an electrical connection from the metal cold water pipe to the metal hot water pipe at the water heater. Like this...
On dielectric unions...
Something else "electrical" and interesting about water heaters (just for curiosity sake) is they have an anode rod inside the tank which sort of "electroplates" the tank to prevent it from developing leaks...
Anyway plumbing can be quite "electrical"!