Justice does not, David Hume argued, arise from judges with a rigorous concern for equity. It arises, like other social goods, from the mysterious harmonization of self-interested actions: “as the self-love of one person is naturally contrary to that of another, these several interested passions are obliged to adjust themselves after such a manner as to concur in some system of conduct and behaviour. This system, therefore, comprehending the interest of each individual, is of course advantageous to the public; tho’ it be not intended for that purpose by the inventors” (quoted in Invisible Hands, 260).
This leads him to the conclusion that, in the words of Jonathan Sheehan and Dror Wahrman, “the public good is often not served by the dispensation of justice in any specific circumstance.” In Hume’s own words, “A single act of justice is frequently contrary to public interest; and were it to stand alone, without being follow’d by other acts, may, in itself, be very prejudicial to society” (quoted, 260).
This doesn’t make any difference in the aggregate, since “however single acts of justice may be contrary, either to public or private interest, ‘tis certain, that the whole plan or scheme is highly conducive, or indeed absolutely requisite, both to the support of society, and the well-being of every individual” (quoted 260-1).
Hume gives us a legal-system-as-market, guided toward justice by a mysterious non-divine providence, a justice achieved without need to meet the always-elusive requirement that judges be just.