At the risk of being accused of usurping religious and moral topics, I shall try to answer this question based on experience, which, admittedly, may be unique, but I suspect is universal.
If you look back at your own youth, from the time you became aware of your parents' actions and beliefs (probably at 5-6) to your early teenage years, you will conclude that what your parents believed, you believed, including whatever religious beliefs your parents espoused. If you were brought up in a conventional church-going family, you developed a belief system based on your parents' religious beliefs. Among other things, they undoubtedly sent you to church school from the age of 4 or 5 through your early teens, and like any good student, you learned to be a religious person. In essence, you became a youthful mirror image of your parents with respect to religious matters, which means that if your parents were consistently religious, so too were you.
As a child reaches the pre-and-early teenage years, however, he or she becomes both self aware and aware of parents and their behavior. At this point, children often begin to think more independently, and this includes becoming more critical (most often in a good sense) of parents. Parents' behavior and beliefs come under increasing scrutiny. Sometimes, children in their early teens begin to rebel against parents, and that rebellion includes parents' beliefs, the most obvious of which might be religious beliefs in a religious family. The consequence is that children, often at 11 or 12, begin to reject certain aspects of their parents--often, religious beliefs are the first to be challenged because that challenge is the most dramatic and emotional in a religious family.
A child's challenge of previously unchallenged beliefs is a natural consequence of the child's growing independence (often propelled by hormones), and the reality is that such challenges are a good sign, if not entirely welcome by the parents.
It differs. Typically, a child adapts to what religion he/she grew to; the belief that his/her parents instilled to him/her. But in other cases, a child's religious belief may be different from his/her family because it can be influenced by his/her peers, teachers, TV, internet, books; and others.