In some of those studies, the wine drinkers get more cancer. Red dot to the right. In some they get less. Red dot to the left.
Conversely, if you have a similar study aiming to prove that wine prevents cancer, how do you prove that wine is the reason a person did not get cancer? It seems much more difficult, because now you are saying X did NOT happen because of Y rather than Y caused X. I'm struggling to articulate this. Maybe you're right.
First, a confounding variable doesn't work like that. It's a hidden variable that's linking that independent and dependent variables that you didn't account for. So, for instance, if you look at the correlation between ice cream and sunburns, you might see a strong correlation, and you might naively think that one causes the other if you don't account for the confounding variable of hot summer days.
In the case of population-wide studies on food, there is always the danger of confounding variables: if you are just comparing the wine drinkers vs non, who are these non-wine drinkers? What makes them non-wine drinkers? As a whole, do they tend to be more heath-conscious? Is that why they're less likely to get cancer? Etc etc.
Second, my point is that in both studies that show foods causing cancer vs those protecting against cancer, it's almost always populations studies. So in an ideal experiment, they have two identical populations, one of whom just happens to eat more chocolate. If that group gets more cancer they say they the chocolate is causing cancer. Similarly, if they get less cancer, they say it's protecting them from cancer.
You don't have to prove that individual X would have gotten cancer if it weren't for the chocolate. All you have to show is that the standard, base-line amount of cancer you'd see in any population is reduced in this group.