This is the process by which most adults acquire a new language, through hard work and memorization. As with any sort of learning, some children are quicker than others. Personalities play a part as well. Some children will accept different languages and others won't. Many children will not accept another language if English is the family mother tongue.
Language is also a byproduct of emotional attachment.
The small child responds to language or languages of their caregivers. They accept one language from one person, another from someone else, if it is done in a consistent way.