At the Democratic debate on Thursday, April 14, Bernie Sanders was asked about his previous support for a law that could halt a lawsuit against gun manufacturers from the parents of victims of the Sandy Hook Elementary School mass shooting.

Sanders has long been criticized for his moderate record on guns. But he faced particular criticism from his Democratic rival, Hillary Clinton, who has said the 10-year-old law gives gun companies legal immunity to lawsuits. (Clinton voted against the law as senator.)

The controversial law is the 2005 Protection of Lawful Commerce in Arms Act (PLCAA), which protects gun manufacturers and sellers from lawsuits that hold them liable for dealing in firearms that end up in criminal hands. In 2015, a judge cited the law to stop a lawsuit from the parents of an Aurora, Colorado, mass shooting victim against gun and ammo sellers that supplied the shooter with thousands of rounds of ammunition.

But the law is more complicated than Clinton suggested. The PLCAA does not provide full legal immunity to the gun industry under some circumstances. And it's unclear if the law single-handedly stopped any successful litigation against gun makers and sellers.

The law established explicit legal protections for gun manufacturers and sellers

The PLCAA passed in 2005 in response to several lawsuits that claimed gun makers and dealers were responsible for letting firearms get into the hands of wrongdoers and criminals.

The lawsuits took various forms: Some argued that the gun industry sold way more firearms in some areas than could possibly be necessary, ensuring that many of those excess guns would end up in the black market. Other times, litigants claimed the industry was purposely packaging dangerous firearms — such as assault weapons — in a way that allowed them to evade gun control laws like background checks, again putting the firearms in criminal hands.

The lawsuits argued that gun makers and sellers were engaging in negligent marketing, and could and should have taken steps to prevent a shooter from getting a gun in the first place. "The essence of the claim is gun manufacturers and sellers have a duty to anticipate, and control for, the criminal misuse of their products," John Goldberg of Harvard Law School wrote in an email.

The PLCAA, which the National Rifle Association supported, largely ended these types of challenges by providing explicit legal protections to gun manufacturers and sellers against negligent marketing and public nuisance claims. Since the law passed, it's been repeatedly cited by judges as they dismiss lawsuits against the gun industry.

"It provided gun dealers with the ability to stave off this litigation without paying lawyers' fees"

Adam Winkler of the UCLA School of Law said many of these challenges were likely to fail anyway, since "the law generally doesn't hold people liable for other people's criminal behaviors." Still, the PLCAA provides an easy way to get a lawsuit dismissed without paying for expensive court proceedings. "It not only staved off litigation," Winkler said, "but it provided gun dealers with the ability to stave off this litigation without paying lawyers' fees."

But the law didn't immunize gun companies from all legal liability for their products. They can still be held liable if they make or sell a deficient firearm that, for instance, explodes during normal use and injures or kills the user or a bystander. And they can also be held liable for "negligent entrustment" — for example, if a gun shop sells an 8-year-old a gun and the child accidentally shoots someone, the store can be held liable by the shooting victim.

So there are some things gun manufacturers and dealers can still be sued for — just not the specific claims the PLCAA prohibits.

Some extreme cases of negligence can also bypass the PLCAA. On October 13, a court found Milwaukee-based Badger Guns liable for negligence after a gun it sold was used in the shooting of two police officers. But this was a very rare, clear case: There was a lot of evidence that Badger Guns facilitated illegal straw purchases — when someone buys a gun for another person who legally can't. A case with less evidence likely wouldn't make it through the PLCAA.

But what makes this story more complicated is none of the lawsuits leading up to the PLCAA's passage actually succeeded. Time and time again, courts dismissed the challenges, or juries rejected them. But the gun industry and its advocates were concerned that a challenge would eventually break through — and cost them a lot of money.

Lawsuits against the gun industry failed prior to the PLCAA, but one could have eventually broken through

Even before the PLCAA passed, litigation against gun makers and sellers consistently failed in court. In the book Suing the Gun Industry, Wendy Wagner of Texas Law wrote that "gun litigation has been an utter failure" — the gun industry had been able to mount a successful legal defense against the lawsuits, usually getting the litigation dismissed before it went to trial.

But the NRA and lawmakers were concerned that one of the lawsuits could eventually succeed, setting a precedent that would expose the gun industry to costly litigation.

The fear wasn't far-fetched. Timothy Lytton of the Georgia State University College of Law said it's typical for new court challenges to go through years of legal strategies and theories before one is successful. "Generally litigation phenomena grow and grow, and then at some point, sometimes they break through, and there are theories that win," he said. "You don't really know that until you've tested enough theories or had enough factual scenarios."

The NRA and lawmakers were concerned that one of the lawsuits could eventually succeed

Referencing Halberstam v. Daniels, Lytton noted some cases got close to succeeding. In that case, a gun manufacturer sold an assault weapon commonly used in street crimes, but avoided gun control laws like background checks and serial number requirements by packaging the firearm as a gun kit that you had to put together. This was legal, but the litigants argued it was negligent behavior — and pointed to an actual shooting on the Brooklyn Bridge as evidence that it could get people killed.

The jury agreed the manufacturer was negligent, but ultimately decided that the manufacturer couldn't be held liable because the gun had gone through too many hands after the initial sale.

"There were a variety of scenarios where the court might have found negligence or the jury might have found negligence, but there was one element or another missing," Lytton said. "As is often the case, you take the facts as you find them. And sometimes it takes a number of years in order to figure out what the right theory is and to have the right factual scenarios to figure out what's going to succeed."

The gun industry also worried that legal proceedings could expose industry secrets that would make gun manufacturers and sellers look bad — including connections to illegal trafficking. As Wagner wrote, the courts "provide litigants with direct access to industry files and personnel, which serves to enhance industry accountability in a way that might not be possible if industry oversight were left exclusively to the political process and agency enforcers."

But all of this was cut short by the PLCAA — even before litigants could figure out if these new types of legal challenges could prevail through different tactics.

Sanders's support for the PLCAA shows his unusual moderation on guns

Given the effects of the PLCAA, it's not surprising that anti-gun Democrats have been hitting Sanders hard for his vote. But the broader argument is about much more than the PLCAA.

For many liberals, Sanders's support for the PLCAA represents a bigger weakness: The self-described democratic socialist has an unusually moderate track record on guns. For example, although he supports expanded background checks, he voted against the federal law that established the checks in 1993 — due to his opposition to a five-day waiting period for gun purchases.

Sanders's moderate voting record — both as a representative and a senator — reflects the will of his constituents. Although Vermont is generally liberal, it's a predominantly rural state with a strong gun culture. Sanders has tried to frame his state's roots as an advantage — he claims he can "bring us to the middle" on guns — but the moderation has dragged down a candidate who's otherwise beloved by liberals.

But as Vox's Andrew Prokop explained, moderation on guns is also crucial to Sanders's overall political strategy: He believes he'll need to attract white, elderly, and rural voters — who traditionally vote Republican — to the Democratic Party to achieve a "political revolution" and pass progressive policies through Congress.

"I do not know how you can concede the white working class to the Republican Party, which is working overtime to destroy the working class in America," Sanders told Prokop in 2014. So if he took a hard line on guns, he could alienate these voters, and his bigger ambitions on domestic policy could falter.

Still, the criticisms seem to be pulling Sanders to the left on the gun debate. In an October interview with NBC News's Chuck Todd, Sanders indicated that he supports tweaking the PLCAA to allow some legal challenges against the gun industry:

If you were a gun shop owner in Vermont, and you sell somebody a gun, and that person flips out and then kills somebody, I don't think it's really fair to hold the [gun shop owner] responsible. … On the other hand, where there is a problem is there is evidence that gun manufacturers do know that they're selling a whole lot of guns in an area that really should not be buying that many guns — that many of those guns are going to other areas, probably for criminal purposes. So can we take another look at that liability issue? Yes.

Earlier in January, Sanders announced that he now opposes the law. Now he supports a bill that would repeal the law together.

But even if Sanders is okay with holding the gun industry accountable, and only voted for the PLCAA to protect small Vermont businesses, his 2005 vote and the rest of his record cast doubt on his authenticity on this issue. So as school shootings and mass shootings continue to fuel Democratic calls for gun control, the decade-old vote has put Sanders in an odd position he's not used to: the center of liberal criticisms.