“Language development is thought to proceed by ordinary processes of learning in which children acquire the forms, meanings, and uses of words and utterances from the linguistic input. Children often begin reproducing the words that they are repetitively exposed to. The method in which we develop language skills is universal; however, the major debate is how the rules of syntax are acquired.There are two major approaches to syntactic development, an empiricist account by which children learn all syntactic rules from the linguistic input, and a nativist approach by which some principles of syntax are innate and are transmitted through the human genome.”
Given the extreme complexities of most languages, the question of how children (relatively effortlessly) acquire their first language, is as yet largely unexplained.
Since the time of Plato, various (sometimes incompatible) theories have been put forward.
See: Wikipedia's main article on Language Acquisition