According to Gary Taubes, writing in the New York Times Sunday Review, we don't really know.
Here is Taubes:
Here’s another possibility: The 600,000 articles — along with several tens of thousands of diet books — are the noise generated by a dysfunctional research establishment. Because the nutrition research community has failed to establish reliable, unambiguous knowledge about the environmental triggers of obesity and diabetes, it has opened the door to a diversity of opinions on the subject, of hypotheses about cause, cure and prevention, many of which cannot be refuted by the existing evidence. Everyone has a theory. The evidence doesn’t exist to say unequivocally who’s wrong.
One lesson of science, though, is that if the best you can do isn’t good enough to establish reliable knowledge, first acknowledge it — relentless honesty about what can and cannot be extrapolated from data is another core principle of science — and then do more, or do something else. As it is, we have a field of sort-of-science in which hypotheses are treated as facts because they’re too hard or expensive to test, and there are so many hypotheses that what journalists like to call “leading authorities” disagree with one another daily.
If I'm not mistaken, Taubes is leading an effort to raise funds to experimentally test his conjecture (related to effects of sugars and other carbs) about a cause of obesity. He has written persuasively about his views, but rather than leaving it at that, he's putting his money where his mouth is, and using scientific experiments to test his theory. Good for him.