The citations that provides evidence that it's NOT just "locals knowing what food to avoid" have already been posted. But apparently you missed that part...Or maybe you are just intentionally ignoring that.....
Drinking water precautions?
The idea that it's just "locals knowing what food to avoid" and only that, is what is called "just making stuff up". Unless, of course you have some proof that is the case, which you don't.
I did read each of the linked articles from beginning to end.
Not one addressed the issue of long-term residents having local knowledge that helped them avoid foodborne illness. Each was specific to travelers' diarrhea and discussed issues pertinent to people traveling from one area to another. One of the articles made some comparison between local residents and visitors in terms of susceptibility to some infections, but didn't go into potential reasons why.
Not one single one of those articles said anything at all about whether local residents might have local knowledge that helped them avoid foodborne illness.
Nobody has said anything like "it's just "locals knowing what food to avoid" and only that" until your last post. The post to which you objected said "Locals are just better at avoiding bad food". "Just", in this case, means "simply". You have for unknown reasons imputed that the poster was saying that was the only factor, which was not stated.
What in any of the linked articles addresses whether residents of an area are better at avoiding contaminated food or not?