One of the TED talks I have watched recently was by Patricia Kuhl on the linguistic genius of babies. Research has found that young children have a greater ability to learn other languages. There is a critical period in which the brain in more open to learning other languages. Young children to the age of seven are geniuses for learning other languages but after that there is a decline and it becomes more difficult to learn other languages.
It seems that babies learn and take statistics on what sounds they hear and then work on those sounds.