Before the Miracle. 5 When Jesus raised his eyes and saw that a large crowd was coming to him, he said to Philip, “Where can we buy enough food for them to eat?” 6 He said this to test him, because he himself knew what he was going to do. 7 Philip answered him, “Two hundred days’ wages worth of food would not be enough for each of them to have a little (bit).” 8 One of his disciples, Andrew, the brother of Simon Peter, said to him, 9 “There is a boy here who has five barley loaves and two fish; but what good are these for so many?”
The miracle is initiated by Jesus. Just as Jesus initiated contact with the Samaritan woman (4:9) and initiated the healing of the man by the pool (5:6), so also here he anticipates the hunger of the crowd. His question, “Where can we buy enough food?” is a different question from “How can we provide enough food?”
Philip was the natural person to ask where food might be found to feed them all, for he was a native of nearby Bethsaida (1:44). Perhaps Philip’s answer would have been the same, but the latter question might have helped Philip focus on what is one of the central christological questions in John’s gospel: the source of Jesus’ gifts. If one knows the source of the gifts, one is closer to recognizing Jesus’ identity (consider 4:10). But as Philip and Andrew (also from Bethsaida) point out, in the natural course of things, there is no way that everyone can have enough; in the natural course of things.
As an aside, one wonders if that same dynamic is in place in our time when people offer the answer to the question as a “miracle” took place in people’s hearts. In such thinking, Christ induced the selfish to share their provisions, and when this was done there proved to be more than enough for them all. As Morris  notes, such a view relies “too much on presupposition and [overlooks] what the writers actually say. It is much better, accordingly, to hold … the view, that Jesus, the Son of God incarnate, did do something that we can describe only as miracle.” That said, let us return to the commentary.
Jesus knows the answer to the question—he knows what he is going to do—and he discovers that his disciples are unable to answer his question. Instead of seeing that Jesus’ question is about himself, the two disciples interpret the question on the most earthly level and so give earthly answers: There is neither money nor food enough to feed so many people.
O’Day point out  that this “exchange between Jesus and his disciples prepares for the miracle in several ways. Philip’s and Andrew’s responses communicate how daunting the size of the crowd is and hence the huge quantity of food that would be required to feed them. More important, the disciples’ answers show how traditional categories cannot comprehend in advance what Jesus has to give. Conventional expectations offer no solutions to the crowd’s needs; Jesus alone knows how to meet those needs.”
John 6:5 When…he said: Jesus takes the initiative. In the synoptic’s narrative, it is the disciples that do. It is this initiative that possibly pictured Jjesus as (cf. Jn 6:14) the new Moses (cf. Nm 11:13).
John 6:5 “Where can we buy enough food for them to eat?” This is the question that Moses asks of YHWH is the desert (Num 11:13), but Jesus’ concern was rhetorical. The question is meant to test the faith of the apostles to believe something greater than Moses was here with them.
John 6:6 he himself knew what he was going to do. This aside is a key to understanding the miracle story and the following discourse. Jesus knew (ēdei; pluperfect of oida, “to know”, thus Jesus’ knowing is ongoing) and is in control of all that is happening. He said this to test them: Likely the evangelist’s own comment; in this gospel Jesus is never portrayed as ignorant of anything.
John 6:7 Two hundred days’ wages worth of food would not be enough… This phrase echoes the account of Elisha’s feeding of 100 men in 2 Kings 4:42-44. days’ wages: literally, “denarii”; a Roman denarius is a day’s wage in Mt 20:2.
John 6:9 barley loaves: the food of the poor. Philo says of barley meal, “as a foodstuff it is of somewhat doubtful merit, suited for irrational animals and men in unhappy circumstances.” There seems an allusion to the story of Elisha multiplying the barley bread in 2 Kgs 4:42–44.