Passages like this teach us that government, whether human or Divine, uses both Law and Grace to establish justice. Let's look first and briefly at the role of law in establishing justice and righteousness. This is true of both human and divine government. The bible teaches in many places that God will punish wrongdoing, and judge between his people and those who oppress them. But Law cannot motivate love, nor can it result in salvation, for no one perfectly keeps the law of God.
Law convicts but only grace can save and produce works of righteousness and justice.
Through mercy, Grace establishes justice by restoring right relationships with God and Man, which lead to lives lived in love. But now a righteousness from God, apart from law, has been made known, to which the Law and the Prophets testify. This righteousness from God comes through faith in Jesus Christ to all who believe. God presented him as a sacrifice of atonement, through faith in his blood. That is, made righteous.