I’m quoting here from Keith Devlin’s book The Math Gene.
First, a experiment from Piaget:
… Piaget believed that children do not have a number sense until they acquire it at around four or five years of age. In one of Piaget’s experiments, repeated many times by different groups, a psychologist would show a four-year-old child two equally spaced rows of six glasses and six bottles and ask whether there were more glasses or more bottles. The child invariably answered that there were the same number. Presumably the child observed a one-to-one correspondence between the rows. The experimenter then spread out the glasses to form a longer row and asked the child again whether there were more glasses or more bottles. Now the child would answer that there were more glasses, apparently misled by the longer length of that row. “Obviously,” Piaget concluded, “this shows that the child does not have a properly developed number sense.”
This conclusion was overturned later in a spectacular fashion by James McGarrigle and Margaret Donaldson:
Like Piaget, they started by aligning two rows of the same number of objects and asking the child which row had more objects. After the child responded correctly, the experimenter pretended to look away while a teddy bear puppet lengthened one of the rows. Turning back, the experimenter exclaimed, “Oh dear, that silly teddy has mixed up the rows. Can you tell me which row has more objects again?” Children from two to five invariably gave the correct answer. Since the teddy bear had rearranged one of the rows, unseen by the experimenter, the child presumably found it reasonable for the adult to ask the same question again. Yet when the experimenter repeated the process with the same children but rearranged the objects him- or herself, the four- and five-year-old children responded exactly as they had for Piaget, basing their answer on length.
In other words, the children modified their answer based on the expectation of what they thought the adult wanted to hear.