Matthew 15:29-39 Jesus Feeds the Four Thousand
Have you ever had to learn a lesson more than once? The disciples certainly did. There may be something else going here, too.
In the first story, there were twelve basketfuls leftover. Twelve tribes, twelve apostles. The Jewish nation.
In the second there were seven. When Joshua conquered Canaan, there were seven Canaanite nations: the Canaanites, Amorites, Hittites, Jebusites, Hivites, Perizzites, and Gigashites. The number seven came to represent Gentile nations. The woman in the previous story was a Canaanite.
There is enough grace leftover after feeding Israel to also feed the Gentiles.
The Gospels are not random stories that were put together, Jesus was very intentional in revealing Himself and His mission.