Legal bias against the poor, and competition from nonstate legal services providers, can both seriously affect state justice provision. But analyses of these factors often fail to incorporate a critical feature of justice systems: states use them for revenue generation. I build a series of formal models to understand how these factors interact. I derive several insights into empirical patterns of bias, competition, access to justice, and legal system viability. First, in poor countries, bias can increase access to justice and legal effectiveness. Second, given competition, poor groups will pay a premium for state-provided justice, while wealthy groups will pay a premium for private dispute resolution. However, losing a poor group to competition is also less costly than losing a wealthy group, and the latter loss can sometimes destroy the viability of the state justice system. These results contribute to our understanding of state capacity and rule of law development.