Take a look at this astonishing (and adorable) video demonstrating how a baby acquires object permanence.
At 6 months old, the baby can see and reach for an object, but as soon as it is hidden, she doesn’t seem to realize it’s there. The baby is interested and excited by the objects, but when they’re not visible, it’s as if her memory has been wiped clean.
By 10 months, the phenomenon has vanished and the baby behaves like any older child would, clearly realizing that the book is hidden under the blanket and immediately uncovering it.
But 10-month-olds will make another error. If you have two possible hiding spots (say, a white blanket and a blue blanket), you can easily “trick” the baby. First, hide the object under the white blanket. While she watches, move it to the blue blanket. Then let her search for the object. She will look first under the white blanket, despite having seen the object move.
An even more advanced problem involves moving the hiding places themselves. Suppose you set up the following scenario, with two different-colored cups designed to hide a toy on a platform that can rotate freely:

If you hide the toy as shown in the diagram, then rotate the board 180 degrees in full view of the child, even three-year-olds are unable to choose the correct hiding place more accurately than if they’d simply chosen at random. They do a little better if you rotate the platform a full 360 degrees, but this is presumably only because the hiding place is actually the same as if the tray hadn’t moved at all.
By the time they are five, kids do better at this task, but they still aren’t perfect, especially if they tray is rotated while hidden from view.
Researchers including Irene Pepperberg have tested animals in some of these same tasks. Pepperberg found that African grey parrots could easily pass the object permanence task. Great apes have been similarly successful. Others have tried the more difficult spatial localization task with monkeys but found mixed results.
So last year, Sanae Okamoto-Barth and Josep Call systematically gave three tests to children ranging from three to nine years old, and to adult chimpanzees, gorillas, bonobos, and orangutans. In addition to the first task I mapped out above, they also gave more difficult tasks where only the platform itself (not the containers) gave a clue as to where the object was hidden:

As expected, when the platform was visible while rotating, all the children five and older were easily able to find the hidden toy. But when the platform was hidden, things were not so simple:

As the kids got older, they got better at the tasks. Note that three-year-olds were actually worse than chance when the only clue to the platform’s orientation was top/bottom coloring. They seemed simply to reach for the spot where they had seen it hidden. Even nine-year-olds weren’t perfect in this condition, but they did perform the task more accurately than the 50 percent that would be expected if they had simply guessed.
So, how do apes compare?

For the apes, there was no significant difference in the type of display, so this graph shows their combined results for the 180-degree rotation. Like the children older than 3, they were very accurate for visible rotations, but when the rotations weren’t visible, the apes responded more like three-year-olds.
The researchers suspected that this response pattern may have been due to the fact there wasn’t a marker on the container where the treat (food for the apes; a toy for the kids) was hidden. In other studies, when a marker was near the container hiding the treat, some chimpanzees were able to find it. So the three-year-olds and apes were given one more test, where a marker was placed on the treat’s hiding place. Here are those results, again for a 180-degree rotation:

Both 3-year-olds and apes were very accurate when the rotation was visible, but when the platform was rotated while the hidden, the apes were unable to perform the task, and in fact reached more often for the container in the position where the treat had been hidden previously instead of the one with the marker. The children were just as accurate at the hidden task as the visible task.
Why the difference? It may have more to do with environment than intellectual capacity. The chimps that had succeeded in a separate study had been previously trained in symbol use. Perhaps, even if they haven’t been exposed to this particular task, children gradually learn about objects, containers, and maps, and can apply those skills in the laboratory. The apes in this study hadn’t had enough exposure to that sort of environment, and so didn’t ever learn the skills needed to perform the task.
Okamoto-Barth, S., & Call, J. (2008). Tracking and inferring spatial rotation by children and great apes. Developmental Psychology, 44 (5), 1396-1408 DOI: 10.1037/a0012594