How could scientists come to such conclusions? Of course, experimentally. By showing and then hiding behind a veil various objects - a triangle or a disk. Then they measured the length of focus on objects. It turned out that the babies reacted "normally" when there was an object or other item previously shown behind the curtain. The surprise came only when there was no object after the veil was unveiled.
This showed that a baby of this age is not able to remember exactly what object is hidden behind the veil, but remembers its existence.