Justice is supposed to be blind, but that fiction is hard to maintain when lawyers contribute millions of dollars to the election campaigns of favored judges. In states like Texas, Alabama, and West Virginia, where judicial elections are vigorously partisan, it’s not uncommon for judges to collect hundreds of thousands or even millions of dollars in campaign contributions. Suspiciously, most contributions come from lawyers who invariably find themselves with cases before these same judges.

Big money judicial elections intersect with another shameful secret of American courts: “home cooking,” the tendency of state courts to be biased against out-of-state corporate defendants. Richard Neely, a former judge on the West Virginia Court of Appeals, explained his incentives as an elected judge this way: “As long as I am allowed to redistribute wealth from out-of-state companies to injured in-state plaintiffs, I shall continue to do so. Not only is my sleep enhanced when I give someone else’s money away, but so is my job security, because the in-state plaintiffs, their families, and their friends will reelect me.”

Neely’s comments are backed up by the data. In research published in 1999 in the Journal of Law and Economics, my co-author, Eric Helland, and I found that awards against out-of-state defendants are on average $250,000 higher in states that use partisan elections to select their judges compared to states that use other judicial selection methods.

We further tested the theory by looking at awards made by federal judges, who are appointed not elected. Importantly, we found an out-of-state-bias only when partisan-elected state judges were involved in these cases but not when similar cases were taken away from the state courts and tried before federal judges.

Home-cooking is particularly egregious in class action lawsuits. Many of these lawsuits are a scam designed to enrich plaintiff’s lawyers. The scam is simple. Find any pretext for a lawsuit so long as the class of people involved is very large—millions of potential claimants is perfect. Sue the defendant and have the class certified in a state court where the judge is friendly because of the generous—and perfectly legal—contribution that you made to his election campaign. Encourage the defendant to agree to a settlement that includes millions of dollars in attorneys fees and a token payment, usually a coupon, to the plaintiffs.

It’s safe to say that most judges, whether elected or appointed, rule without bias. But all it takes to drive awards sky high is a single judge willing to steer juries toward multi-million dollar awards. That’s why lawyers from across the U.S. fly to states like Texas and Alabama to file their class action suits.

Home cooking interferes with good public policy even in states, like California, that do not have partisan judicial elections. Many states, for example, wisely encourage the use of generic pharmaceuticals because these are considerably cheaper than the name brands. Similarly, some states encourage the use of generic auto replacement parts because they are much cheaper than parts from the original car manufacturer. As with pharmaceuticals, there is no evidence that generic auto parts are of lower quality than parts made by the original manufacturer.

Yet, in a recent class action, an Illinois state court awarded plaintiffs and their lawyers more than one billion dollars because State Farm Insurance Co. encouraged the use of generic replacement parts. Fearing similar claims, other insurance companies are now requiring that only parts from the original manufacturer be used. The switch to higher-priced non-generics and the resulting reduction of competition in the auto parts market increases insurance premiums nationwide. Although the federal courts are hardly perfect, they at least tend to take into account a broader range of issues and interests than do the parochial state courts.

A good first step to remedying these injustices would be to decrease the plaintiff bars’ ability to bring claims before friendly state court judges. Congress can do this by increasing the jurisdiction that federal courts have over large class-action suits. A bill the House of Representatives recently passed, for example, gives federal courts jurisdiction over class action suits when the plaintiffs are from many different states and the total claims exceed $2 million. Increased federal jurisdiction of class actions will put decisions in the hands of judges who have a national vision and who don’t need to home cook to raise funds for their reelection campaigns.