I know it's not really science, it's science reporting, but this article from Aeon points out that the "thermodynamic" model of calories in vs. calories expended for the obesity epidemic doesn't explain, for example, why other species (the article cites mice and marmosets) are also getting fatter, or why a daily calorie variation of less than 2% does or doesn't cause us to gain weight.
Chemical, cultural, and hereditary causes are considered. As with most things, I doubt there's a single (or even one major) cause; I suspect it's a convergence. We may find that all of the factors noted in the article are in play, or only a few, or that there's other stuff we had not even considered.
Some of whatever leads to our body size is undoubtedly just dumb luck.