Babies do not perceive phonemes, but instead can hear all of the distinctive features that build the phonemes of every language.
Babies hear no phonemes in those first few months of life.
Ironically, however, their hearing is fully functioning by the time of birth. In addition, they possess some rather amazing auditory perceptual skills, apparently wired in before birth, which make them in some ways superior listeners to adults.
Whereas they don't hear the phonemes of a language, they can perceive the building blocks (the distinctive features) of all languages!
It is believed that the neural connections for distinctive features that are reinforced by the environment are strengthened, while those that are not stimulated are lost.
Hence in adulthood, my ability to hear the distinctive features that contribute to phonemes of languages not spoken in the home when I was a child, is lost.
A good example is Voice Onset Time.