Chimpanzees were equally adept at solving this problem. Chickens apparently cannot plan to use a roundabout approach, and so are left helpless. Dogs and chimpanzees are able to plan in these situations, running directly away from the food to exploit a longer but unrestricted path to the goal. That dogs have the capacity to remember local territory is not surprising when we consider that they once hunted over a wide range of territory, yet returned home nightly to a permanent den. Finding an efficient route home from wherever the day's hunt takes the pack has considerable survival value over re-tracing the path taken on each particular day.
Chimpanzees are also territorial animals with a keen interest in local terrain.
Without the ability to remember things that are not immediately present, planning would be impossible. Finally the moment has come to act upon our plan. Oftentimes, our actions change the world in some way, if only to change our relationship with our immediate surroundings. When we are walking, our movement through the world exposes us to different terrain. If we open the refrigerator, we can now see what is inside that we might like to eat.