So if you wanted to gather plant food how do you make sure that the food you find is edible?
It's quite simple. If you know a plant is edible you take the seeds and you carry them with you and broadcast them all over the place.
The interesting part about this is that this is also a form of selective breeding, since you're choosing the edible plants over the inedible plants.
Note that you do not tend to the plants or do any form of agriculture, you're still foraging from random plants you encounter.
And yet despite that it can quite happily plan out and navigate a route that is hundreds of miles long, at roughly 20 times the speed it was designed to travel at.
I'm sitting here writing a text message to someone 1800 miles away giving them directions to a shop in Vienna and I can visualise where they need to go for that to all work, with a brain that evolved to think about "not the next hill but the one after that" distance.