21:1-9 When a crime was committed and the criminal got away, the whole community was held responsible. In much the same way, if a city has a dangerous intersection and someone is killed there, the community may be held responsible for both damages and repairs. God was pointing to the need for the whole community to feel a keen sense of responsibility for what was going on around them and to move to correct any situations that were potentially harmful—physically, socially, or morally.
21:18-21 Disobedient and rebellious children were to be brought before the elders of the city and stoned to death. There is no biblical or archaeological evidence that this punishment was ever carried out, but the point was that disobedience and rebellion were not to be tolerated in the home or allowed to continue unchecked. These principles must never be used to justify or overlook abuse or harsh treatment of children. While firm guidance may be needed with strong consequences for disobedience, the Bible does not condone physical, verbal, or emotional abuse of children.