It depends on your definition of “dirty water.”
When agriculture was invented, it created large numbers of people in one place. This pollutes water, mostly because humans shit all over the place and then dump it in the river. This happened to a much greater extent when we industrialized, with coal dust and other toxins getting into the water supply. Which we now need to (and do) filter out.
This wasn’t a concern for most of Earth’s existence, and, in many remote places, still isn’t a concern. (I’m thinking Arctic here, there’s no significant human or industrial presence.)
It’s also a matter of immune system. If you’re drinking unfiltered water your entire life, you’re going to build up a natural resistance to whatever bacteria may be in that water. This can be seen in modern-day - when many tourists go to somewhere with lower water quality, they’ll get stomachaches from the water because they’re not used to it. (I had that problem when I spent a summer in Warsaw, frex.)
I think they basically have built up a tolerance to those bacteria. They probably got sick at some point and survived.
We’ve evolved to spend more energy on our brain and intelligence. Animals can have better immune systems, plus they’ll build up a resistance to the pathogens.
People who constantly drink dirty water will also develop resistance
at least those that survive, that is
deleted by creator