WASHINGTON — How can it be that Bernie Sanders could stand on the side of vigilantes on the border, against the auto industry bailout, against an immigration overhaul that would have eased the plight of people in the country illegally? Can this be the liberal senator his supporters know and love?

It can be because of the politically perilous way legislation works in Congress, as bill after bill becomes a grab bag of the good and bad — as lawmakers see it. Hillary Clinton took full advantage of that in the latest Democratic debate, pointing out votes by her opponent that are eye-raising on the surface while brushing off complexities that help explain them.

A look at some claims in Wednesday’s debate and how they compare with the facts:

CLINTON: While in the Senate, she voted for a bill that later provided the money to bail out the auto industry. “The money that rescued the auto industry was in that bill,” which she chided Sanders for voting against.

SANDERS: That bill “was the bailout of the recklessness, irresponsible and illegal behavior of Wall Street.”

THE FACTS: Sanders is correct in the main. The bill passed in October 2008 provided $700 billion to bail out big banks. But some of that money was later used for a bailout of Chrysler and General Motors. When Clinton voted for the Wall Street package and Sanders voted against it, neither knew money would be shifted to the auto industry.

When legislation came up separately that proposed explicit support for the auto industry, both voted for it. Then in January 2009, shortly before Barack Obama became president, lawmakers tried to block the release of a second phase of the package approved earlier for the Wall Street rescue. Sanders backed this effort, which failed. At this point, it was known that some of the money would go to the auto industry as well, although it was not known how much.

SUBSCRIBE: Get the analysis of Mark Shields and David Brooks delivered to your inbox every week.

CLINTON: Sanders “stood with the Minutemen vigilantes in their ridiculous, absurd efforts to, quote, hunt down immigrants.”

SANDERS: “No, I do not support vigilantes, and that is a horrific statement, an unfair statement to make.”

THE FACTS: She was right about his vote, perhaps a little over the top in characterizing it. In 2006, as a member of the House running for the Senate, Sanders voted for an obscure and largely symbolic amendment that sought to prohibit Washington from giving information to foreign governments about the activities of a civilian group operating along the border.

At the time, some hard-liners against immigration were concerned that U.S. officials were tipping off the Mexican government about movements of the civilian Minuteman group that was patrolling the border for people crossing illegally.

Sanders said it was an unimportant amendment “supported by dozens and dozens of members of the House which codified existing legislation.” But it stands as an example of lawmakers backing something they might not like — or might not have given enough thought to — in order to achieve larger goals in a bill. As it was, the amendment did not survive and the issue was mostly forgotten — but not by Clinton.

CLINTON: “I think our best chance was in 2007, when Ted Kennedy led the charge on comprehensive immigration reform. We had Republican support. We had a president willing to sign it. I voted for that bill. Senator Sanders voted against it.”

SANDERS: “Well, you have guest-worker programs that have been described by the Southern Poverty Law Center, one of the important institutions in this country who studies these issues, as guest-worker programs akin to slavery… They were cheated. They were abused. They were humiliated.”

THE FACTS: Clinton is right that Sanders opposed the immigration liberalization, but that doesn’t make him an opponent of that goal. As he explained it, the abusive guest-worker program contained in the legislation was so odious that he could not back the broader bill.

What Sanders did not make clear, though, was that his position also reflected concerns of labor unions that the temporary workers would drive down wages and cost Americans jobs. His stance was not all about the plight of the immigrant laborers, as a video played at the debate showed.

CLINTON: Defending her use of a private email server, now the subject of an FBI investigation into whether it was improperly used for classified information, said “it was not prohibited. It was not in any way disallowed… I did not send or receive any emails marked classified at the time… I asked all my emails to be made public.”

THE FACTS: Clinton is correct that when she began using the private email system as secretary of state in 2009, federal law did not explicitly prohibit doing so. But her own department warned its employees against the use of private email to conduct government business because it could compromise classified materials and be subject to hacking.

In the year since Clinton turned over 55,000 pages of emails to the State Department, the agency has since censored hundreds of those emails because they contained classified materials.

And when Clinton agreed last March to turn over “all” of her emails to the State Department and urged their release, she acted only after her aides had combed through all of her private emails, withholding messages that they deemed to be personal. Those decisions weren’t made by federal records specialists who normally decide which materials need to be turned over.

Associated Press writers Alicia A. Caldwell, Jim Drinkard and Stephen Braun contributed to this report.