That may be explained by MN 36. It describes him starving, until he thinks
Whatever brahmans or contemplatives in the past have felt painful, racking, piercing feelings due to their striving, this is the utmost. None have been greater than this. Whatever brahmans or contemplatives in the future will feel painful, racking, piercing feelings due to their striving, this is the utmost. None will be greater than this. Whatever brahmans or contemplatives in the present are feeling painful, racking, piercing feelings due to their striving, this is the utmost. None is greater than this. But with this racking practice of austerities I haven't attained any superior human state, any distinction in knowledge or vision worthy of the noble ones. Could there be another path to Awakening?'
SN 56.11 begins,
I have heard that on one occasion the Blessed One was staying at Varanasi in the Game Refuge at Isipatana. There he addressed the group of five monks:
There are these two extremes that are not to be indulged in by one who has gone forth. Which two? That which is devoted to sensual pleasure with reference to sensual objects: base, vulgar, common, ignoble, unprofitable; and that which is devoted to self-affliction: painful, ignoble, unprofitable. Avoiding both of these extremes, the middle way realized by the Tathagata — producing vision, producing knowledge — leads to calm, to direct knowledge, to self-awakening, to Unbinding.
MN 26 explains the occasion when and context in which he said that,
"Then, wandering by stages, I arrived at Varanasi, at the Deer Park in Isipatana, to where the group of five monks were staying. From afar they saw me coming and, on seeing me, made a pact with one another, (saying,) 'Friends, here comes Gotama the contemplative: living luxuriously, straying from his exertion, backsliding into abundance. He doesn't deserve to be bowed down to, to be greeted by standing up, or to have his robe & bowl received. Still, a seat should be set out; if he wants to, he can sit down.' But as I approached, they were unable to keep to their pact. One, standing up to greet me, received my robe & bowl. Another spread out a seat. Another set out water for washing my feet. However, they addressed me by name and as 'friend.'
"So I said to them, 'Don't address the Tathagata by name and as "friend." The Tathagata, friends, is a worthy one, rightly self-awakened. Lend ear, friends: the Deathless has been attained. I will instruct you. I will teach you the Dhamma. Practicing as instructed, you will in no long time reach & remain in the supreme goal of the holy life for which clansmen rightly go forth from home into homelessness, knowing & realizing it for yourselves in the here & now.'
"When this was said, the group of five monks replied to me, 'By that practice, that conduct, that performance of austerities you did not attain any superior human states, any distinction in knowledge & vision worthy of a noble one. So how can you now — living luxuriously, straying from your exertion, backsliding into abundance — have attained any superior human states, any distinction in knowledge & vision worthy of a noble one?'
"When this was said, I replied to them, 'The Tathagata, monks, is not living luxuriously, has not strayed from his exertion, has not backslid into abundance. The Tathagata, friends, is a worthy one, rightly self-awakened. Lend ear, friends: the Deathless has been attained. I will instruct you. I will teach you the Dhamma. Practicing as instructed, you will in no long time reach & remain in the supreme goal of the holy life for which clansmen rightly go forth from home into homelessness, knowing & realizing it for yourselves in the here & now.'
A second time... A third time, the group of five monks said to me, 'By that practice, that conduct, that performance of austerities you did not attain any superior human states, any distinction in knowledge & vision worthy of a noble one. So how can you now — living luxuriously, straying from your exertion, backsliding into abundance — have attained any superior human states, any distinction in knowledge & vision worthy of a noble one?'
"When this was said, I replied to the group of five monks, 'Do you recall my ever having spoken in this way before?'
"'No, lord.'
"'The Tathagata, monks, is not living luxuriously, has not strayed from his exertion, has not backslid into abundance. The Tathagata, friends, is a worthy one, rightly self-awakened. Lend ear, friends: the Deathless has been attained. I will instruct you. I will teach you the Dhamma. Practicing as instructed, you will in no long time reach & remain in the supreme goal of the holy life for which clansmen rightly go forth from home into homelessness, knowing & realizing it for yourselves in the here & now.'
"And so I was able to convince them. I would teach two monks while three went for alms, and we six lived off what the three brought back from their alms round.
In summary I don't think "ascetism" in this context means, "denial of sense pleasures" -- that's still true -- what it means is more like, "starving" isn't very useful (perhaps that's in contrast with e.g. Jainism).
Instead, eating is permitted -- perhaps not as a "sense pleasure" but as a "requisite".