Anyone who has been around an infant for any length of time can see their imitation skills in action. I have a great picture of my brother holding one of my kids who was about 5-months old. Both of them are sticking their tongue out at the camera. This picture was the result of an hour in which my brother stuck his tongue out, and then my son stuck his tongue out in response.
How does this imitation happen?
One theory, which falls in the "infants don't know that much" camp, assumes that imitation is based mostly on the way that infants represent movements. This theory suggests that the way that people understand the movements of other people is based in part on using the parts of the brain that are associated with making movements. In essence, when we watch someone else performing an action, our own movement system is engaged in simulating what the other person is doing. Infants imitate, because this activity of the movement system prepares them to make the same movements they just observed.
A second theory, which is more in the "infants know a lot" camp, assumes that infants are trying to figure out what the person they are imitating was trying to do. This view suggests that infants are constantly reasoning about why people do what they do, and then they imitate what someone intended rather than what they actually did.