ELI5 : How one get immunity to Traveler's diarrhea when it's a common recommendation to avoid drinking tap water or any non-sealed food / drink ?

[removed]