The White House has been looking at problems with local law enforcement. Not only did the Justice Department issue its report on Ferguson, Missouri, but a presidential task force on 21st Century Policing issued a report in March.

In addition to the social costs, police misconduct costs money. One watchdog group found that Chicago paid out more than half a billion dollars over a 10-year period. How does the tab get so high?

Start with laywers: Scandalously bad policing is Jon Loevy’s bread-and-butter. He runs a for-profit law firm in Chicago, with 25 attorneys, built on big wins in police misconduct cases.

“We like to say it’s a non-depletable good — injustice,” he says. “You know, there’s a million cases out there where people have their rights violated, or wrongfully convicted, or falsely arrested.”

What’s tough is winning those cases, which can take years and lots of upfront investment.

“This is not for the faint of heart,” says Loevy. “Because you don’t get paid unless you win.”

So, having lawyers who are willing and able to take those cases on — and win them — is one variable.

Another is how a city responds to lawsuits. For years, the city of Chicago had a not-quite-official “no-settlements” policy, which is a strategy that may scare away some potential plaintiffs. However, it also means defending cases that are clear losers.

That gets expensive, says Lou Reiter, a law-enforcement consultant and former deputy chief of the Los Angeles police department. Juries will award more in damages than lawyers would settle for. “Then, the attorney gets reasonable fees on top of that,” says Reiter. “And many times that’s much more than the actual jury verdict.”

He consulted with the plaintiff’s attorneys on an infamous Chicago case, in which an off-duty cop beat up a bartender in front of a security camera. The video went viral, and the city refused to settle. The jury awarded the woman $850,000, and the court gave her attorneys more than twice that amount.

Reiter thinks the city could have saved itself a lot of money. “Initially, they probably could have settled that for maybe two, three hundred thousand dollars,” he says.

Legal fees, including payments to the city’s own outside counsel, amounted to about a quarter of the city’s $521 million police-misconduct tab, as tallied by the Better Government Association.

The city of Chicago didn’t comment for this story, but plaintiffs’ lawyers say Chicago’s policy has shifted since Rahm Emanuel became mayor in 2011.

“They’ve really moved to nip some of these cases in the bud,” says Andrew Schroedter, a reporter for the BGA. “If they identify a case where they were clearly in the wrong, they are trying to settle that early on, before it results in an expensive judgment.”

Chicago is not alone in facing these expenses. The Ramparts police scandal alone cost Los Angeles an estimated $125 million.