foods provide energy (calori), but also carry signal
Let's see a simple comparison: starch (polymer) vs sugar (dimer) or glucose (monomer). Eventually the polymer and the dimer get converted to monomer glucose or fructose.
If you view foods simply as energy supply, you can easily substitute your starchy foods such as rice and flour with sweety treats just to get the same amount of calori.
But foods carry signals. And sustained wrong signals can make a healthy person sick, and send an already sick person to grave much quicker.
Like alcohol, sugar was a rather new discovery/invention in the long natural history of human kind, or Homo species. Starch was the natural food, sugar was not.