Compassion first, then the miracle
The setting is a lonely place near the Sea of Galilee. Jesus has withdrawn, but the crowds follow on foot, and instead of turning them away he stays — teaching and healing — until the day is nearly gone. The disciples do the sensible math: send everyone home before they starve. What follows is the point.
In Mark's telling, the miracle begins not with power but with pity: “he saw much people, and was moved with compassion toward them… because they were as sheep not having a shepherd” (Mark 6:34). The disciples find one boy with a few barley loaves and a couple of small fish — enough for a child, not a crowd. And then:
“And he took the five loaves and the two fishes, and looking up to heaven, he blessed, and brake, and gave the loaves to his disciples to set before them; and the two fishes divided he among them all. And they did all eat, and were filled. And they took up twelve baskets full of the fragments, and of the fishes.”— Mark 6:41–43 (KJV)
John adds the human detail that it was a boy's lunch that started it, and Matthew notes the count was “about five thousand men, beside women and children” (Matthew 14:21) — so the true crowd was larger still. It's worth knowing there are actually two feeding miracles in the Gospels: this one, and a later feeding of about four thousand (Matthew 15, Mark 8). The Gospel writers treat them as distinct events.