In my experience, either children understand what “it’s the right thing to do” means and so will do what’s right, or parents say “You have to do what I say!”, or parents lie to their children / tell them religious stories.
Usually all three.
Usually all three.