What happens to law when the righteous are in authority compared to evil?

What happens to the law when the righteous are in authority in comparison to when the evil are in authority? Is there a direct connection?