Ah, I think I can help with contextualizing this some. I have to get two things out of the way that rustle my jimmies first.
First is the phrase "Hippocrates said". While there almost certainly was an historical Hippocrates, he almost certainly did not write most of -- or even all -- of the works of the Hippocratic Corpus. Modern historiography suggests that they were rather written by a group of doctors, for a variety of different audiences, over a considerable amount of times. Of course, it's impossible to write about the history of medicine without talking about the Hippocratic Corpus, so I try to use phraseology like "the Hippocratics," though even this probably suggests a more coherent group than they actually were.
My second jimmy-rustler if you quote, which is apocryphal (https://www.researchgate.net/publication/258099432_Let_not_thy_food_be_confused_with_thy_medicine_The_Hippocratic_misquotation) though widespread. That being said, the sentiment is SIMILAR to what the Hippocratics meant, though they would disagree with the way the quote is used.
To understand this quote, you need to understand the ancient conception of disease. Traditional Western medicine is similar to modern medicine in that it accepts that disease is caused by natural, and not supernatural causes (the classic example is "On the Sacred Disease", about epilepsy), but their understanding of its etiologies and noslogy is super bizarre to moderns. Human health was thought to be caused by the four humors -- blood, phlegm, black bile, and yellow bile. Disease was caused by imbalances of these humors. Breakdown of the humors could be healthy (ie, concotion, or pepsis) -- such as what happens when urine is made. Or breakdown could be unhealthy (sepsis), such as digestion in the gut, though sepsis was also associated with the formation of new life. The life of a human was intimately linked with nature, so the environment dramatically affected the make up of the humors -- living on the second floor was associated with cooler air, and phlegmatics; swampy areas associated with black bile and melancholics. Temperature, of course, was essential; different humors were hot and cold. And I'm sure you can see where this is going -- different foods affected different humors. I'm certainly no specialist on this, but there's a ton in the Hippocratic Corpus if you want to do some googling, and Galen, Avicenna, and plenty of other authors have their opinions about the humoral influences of different foods.
But here is why I find the apocryphal quote disingenuous (or at least how it is used) -- the Hippocratics, Galen, and traditional Western medicine would have felt that the importance of diet was mostly to MAINTAIN a healthy balance of humors, not to treat disease. This makes sense practically too -- there are few effective treatments in this era, and prevention makes the most sense. When a human is diseased, and the humors are unbalanced, then it is the time to use medical treatments such as blood letting, or medicines (the materia media, largely herbal medications, some of which are either used today, or their derivatives are). The Hippocratics would not have felt that "food is thy medicine"; rather, they would have felt that food, along with the climate, elevation, and temperature, are essential to countering natural imbalances in the humors and maintaining good health. When that health broke down, however, medicine was still essential.
I recommend taking a look at Epidemics I and III -- my favorite books in the Hippocratic Corpus. They are very short, and basically the medical journal of a traveling Greek doctor. You can see many of the treatments that were offered to these patients.
So tying back to my second peeve about this quote -- it is pulled out by supporters of "fad diets" to suggest that radical diets are somehow an ancient idea to treat disease (which is a silly point in and of itself; there are plenty of ancient ideas for treating disease that we've rightly given up on). It annoys me as someone who loves medical history because the idea is an anachronism that ignores the humoral context, and it annoys me even more as a doctor because it dramatically overplays our understanding of nutrition, and downplays the effectiveness of medications.
I hope that adds some context!