Train up a child in the way he should go: and when he is old, he will not depart from it. Proverbs 22:6. Meaning that when you train a child early and often, and these lessons are reinforced every day, the child will become an adult who follows the right path because of the early teachings that you provided. Children learn what they live and experience, and it is up to you to train them right from the beginning so that they live these principles and they become a habit.
Morals and principals are not something that happens quickly, instead these are developed over time as a result of repetition and exposure. Children do not know to be compassionate, they learn this on a daily basis, and the same is true of other positive traits and principles. When kids are raised with these expectations then they live them even as they grow into adulthood. If children are trained consistently from an early age this training will stick no matter how old they become.