From what I understand, it's that foods containing lots of fats, sugars, salt etc aren't normally unhealthy, out in the wild. When you're worried about not starving, foods with energy storage substances like sugar are a good thing, and the amount you'll get in some wild fruit or something isn't bad. Salt is an essential thing to get enough of, and overabundance of it in food isn't common. So, rather than evolve some ability to know exactly what substances we need and only want to eat food with those exact things, we have the evolutionary shortcut of "sweet things are good, fatty things are good, salty things are usually good, etc". Our biology hasn't really evolved to for the possibility of us farming stuff that contains sugar on an industrial scale, extracting and concentrating that sugar, and then putting unnaturally large concentrations of it in everything.