Our ancestors evolved over millions of years to survive in their environments. For most of human existence, that environment was characterized by extreme challenges, like scarcity of food, or food that could carry disease, as well as unsanitary conditions and unclean water, withering weather, and so on. It was a dangerous environment, a heck of a thing to survive.
At the center of our defenses was our immune system, our most elegant defense. The system is the product of centuries of evolution, as a river stone is shaped by water rushing over it and the tumbles it experiences on its journey downstream.
Late in the process, humans learned to take steps to bolster our defenses, developing all manner of customs and habits to support our survival. In this way, think of the brain — the organ that helps us develop habits and customs — as another facet of the immune system.
We used our collective brains to figure out effective behaviors. We started washing our hands and took care to avoid certain foods that experience showed could be dangerous or deadly. In some cultures, people came to avoid pork, which we now know is highly susceptible to trichinosis; in others, people banned meats, with we later learned may carry toxic loads of E. coli and other bacteria.
Ritual washing is mentioned in Exodus, one of the earliest books in the Bible: “So they shall wash their hands and their feet, that they die not.”
Our ideas evolved, but for the most part, the immune system did not. This is not to say that it didn’t change. The immune system responds to our environment. When we encounter various threats, our defenses learn and then are much more able to deal with that threat in the future. In that way, we adapt to our environment.
We survived over tens of thousands of years. Eventually, we washed our hands, swept our floors, cooked our food, avoided certain foods altogether. We improved the hygiene of the animals we raised and slaughtered for food.