We learn societal values from our family and society.
Parents raise their children to respect and obey the laws of society, so that when the children become adults, they will know what is expected of them, and what is not allowed.
Many societies educate their children, and provide food and medical care for their children, because our children are the future of our societies.
So, when a society does what is best for the children, society will reap the rewards when those children do become functioning members of our societies.
So, ideally, both the parents, and the communities work together for the good of our children.