AARON SWARTZ , who committed suicide two weeks ago, had been arrested for illegally downloading millions of articles from JSTOR, an archive of academic journals. Once Mr Swartz had returned the material and promised not to distribute or use it, JSTOR pressed no charges. That did not mollify federal prosecutors. They charged him with 13 felony counts, including wire fraud, computer fraud and criminal forfeiture. Then they offered him a deal familiar to criminal defendants everywhere: plead guilty, and get off relatively easily—in his case, six months in a “low security setting”—or take your chances at trial, and face a harsher sentence if you lose. For Mr Swartz, that could have meant a sentence of decades in prison and fines exceeding $1m.

Plea bargains such as this have long been part of the American legal system. In theory they work to the benefit of all parties. The defendant admits his guilt and gets a lighter sentence; the prosecutor notches up a win; and the court is spared the time and cost of holding a trial. The reality is far murkier.

Until the early 20th century, plea-bargaining was widely considered corrupt. But as the number of criminal statutes grew, so did the stress on the courts, and the consequent need to avoid endless trials. During Prohibition the number of criminal cases soared: by 1930 almost eight times as many people were prosecuted for violating the National Prohibition Act as were prosecuted for all federal crimes just 16 years earlier, and the vast majority of convictions—around 90% by 1925—resulted from guilty pleas rather than trials. The end of Prohibition brought down both the number of federal criminal cases—from an average of more than 58,000 a year in the 1920s to around 37,000 in the 1950s—and the rate of adjudications through guilty or no-contest pleas, to around 83% by 1945.

But immigration offences and Prohibition redux—America’s drug war—drove both numbers up in the late 20th and early 21st centuries. In 1990 29,011 defendants crowded the federal court system; by 2010 that number had nearly tripled, to 83,946. Of those, 81,217 pleaded guilty, meaning that prosecutors did not have to convince juries of their guilt beyond reasonable doubt. They merely had to persuade a grand jury to charge the defendants, a far lower standard of proof (not for nothing did a New York judge once say that a good prosecutor could convince a grand jury to “indict a ham sandwich”), and they had to persuade defendants that pleading guilty was a sound rational choice.

They have been helped by another unfortunate legacy of the drug war: mandatory minimum sentences. From 1990 to 2010 the number of federal defendants whose conviction carries at least one mandatory minimum sentence has more than tripled, from 6,685 to 19,896. Intended to ensure fairness and reduce variation in sentencing between jurisdictions, mandatory minimums have instead, in effect, transferred discretion from judges to prosecutors. Many judges dislike mandatory minimums, and last week Patrick Leahy, who heads the Senate Judiciary Committee, called for ending them, but where that ranks among the priorities of the incoming Congress is unclear.

Some have argued that plea bargaining should disappear, too—an unlikely event, given that both prosecutors and defendants do it, and that its abolition would probably smother an overtaxed court system. A more sensible idea would be to require the state to provide the defence with all its evidence—particularly any exculpatory evidence—during the plea process, rather than simply during or before trial. Prosecutors will always wield a great deal of power in the American criminal system; but before a defendant agrees to plead guilty, he ought to know whether the state holds four aces or a busted flush.