Children learn behaviors just like any other animal: by acting on reacting to their environment, including their peers and caregivers.
This is both good and bad news. Good news: Children can be conditioned, or trained. Bad news: They learn behaviors whether the conditioning is intentional or unintentional.
This is a concept that I have watched parents completely fail to grasp. Repeatedly. Many of the behavior "problems" parents complain about are the result of ineffective conditioning (or highly effective accidental conditioning.)
Some examples from work:
Common behavior problem: "Susy naps great at school, but we just can't get her to sleep at home."
Likely cause: Ineffective conditioning. Her parents fail to use the same techniques or routines her teachers use at school. Teacher tells Susy's parents she swaddles her and gives her her pacifier and just lays her in her crib, and she might cry for 10 minutes, but then she's out cold. But Susy's parents forget to swaddle her or give up after she cries for 5 minutes and get her up.
Common behavior problem: "Johnny keeps hitting and pushing his friends at school, and he won't stop even though he gets in trouble with his teacher every time."
Likely cause: Accidental conditioning. Johnny wants attention from his teacher and has figured out that by hitting or pushing a classmate, he immediately gets his teacher to drop whatever she's doing and come over to him, make eye contact, and interact with him.
If I did a headdesk every time parents fail to "grok" this idea, I would have a permanent red spot. (Not to mention brain damage.)
They do things like this:
Parents use X-Brand bottles at home and send Y-Brand bottles to school, then get upset that baby May eats at home, but won't eat at school.
At school Todd has a certain, consistent schedule, which parents see on his Daily Sheets every day. Parents dramatically change schedule on the weekend, then wonder why little Todd is cranky and out of sorts.
Roland cries and throws a fit during drop-off because he is going through separation anxiety, and his parents are worried. They drop in, randomly, just to 'say hi' or get their 'baby fix', and then wonder why Roland is inconsolable when they leave again.