I think the answer lies in the main theme of the entire sutta which is the development of the body and the mind in order to be secluded from sense pleasures so that pleasant or painful feelings do not arise in the mind.
“The development of physical endurance that you have described is not the legitimate development of physical endurance in the noble one’s training. And since you don’t even understand the development of physical endurance, how can you possibly understand the development of the mind? Still, as to how someone is undeveloped in physical endurance and mind, and how someone is developed in physical endurance and mind, listen and apply your mind well, I will speak.”
The Buddha then relates his experience of setting out "to discover what is skillful, seeking the supreme state of sublime peace.”
Before continuing, there were three similes he thought of that helped him realize the importance of being secluded from pleasant and painful feelings.
“In the same way, there are ascetics and brahmins who live withdrawn in body and mind from sensual pleasures. And they have internally given up and stilled desire, affection, infatuation, thirst, and passion for sensual pleasures. Regardless of whether or not they suffer painful, sharp, severe, acute feelings due to overexertion, they are capable of knowledge and vision, of supreme awakening.”
So, even though he way trying to use extreme ascetic practices to "discover what is skillful, seeking the supreme state of sublime peace,” the pleasant and painful feelings didn’t occupy his mind. He was like a dry log, far away from water. Not being hindered by a mind occupied by pleasant and unpleasant feelings, he was able to recall his experience under the rose apple tree.
"Then I thought, ‘Whatever ascetics and brahmins have experienced painful, sharp, severe, acute feelings due to overexertion—whether in the past, future, or present—this is as far as it goes, no-one has done more than this. But I have not achieved any superhuman distinction in knowledge and vision worthy of the noble ones by this severe, grueling work. Could there be another path to awakening?’
"Then it occurred to me, ‘I recall sitting in the cool shade of a black plum tree while my father the Sakyan was off working. Quite secluded from sensual pleasures, secluded from unskillful qualities, I entered and remained in the first absorption, which has the rapture and bliss born of seclusion, while placing the mind and keeping it connected. Could that be the path to awakening?’