House Republicans just did something that looks, at first glance, like political suicide. They passed the American Health Care Act, a remarkably unpopular piece of legislation that would take away benefits that many of their own constituents currently enjoy. Why would they do this?

Surely, House Republicans know the political risks they face from taking this vote. They know that House Republicans paid a price in the 1998 midterms for their push to impeach Bill Clinton, which the public strongly opposed. And many current GOP members were around, or at least paying attention, seven years ago when House Democrats passed the unpopular Affordable Care Act and faced voters’ wrath. Democrats in Congress who supported that bill did around 6 points worse than Democrats who opposed it in the 2010 fall elections, and that vote penalty may have been enough to cost Democrats their majority.

Now, that vote penalty didn’t come automatically. It came because Republicans campaigned extensively against those Democrats who supported the ACA. They demonized Obamacare, taking advantage of voters’ fears and uncertainties about a very large bill that affected a seventh of the economy.

Democrats will undoubtedly do the same to Republicans in the lead-up to the 2018 elections. And really, those ads write themselves. The AHCA, after all, takes away many health guarantees, cuts Medicaid, allows insurance companies to deny care for those with preexisting conditions (including being a survivor of sexual assault), and transfers wealth to higher-income earners.

It was opposed by the American Medical Association and AARP — hardly hotbeds of liberalism. It was drafted in a rapid and secretive process, and voted upon just hours after the text was complete, with only the briefest floor debate, without allowing for scoring by the Congressional Budget Office. Many members admitted they had not read the bill. Pretty much everything Republicans accused the ACA of doing in 2009-’10, they did with the AHCA.

So why would Republicans do this? They already face a difficult election next year — midterm elections are often rough on the president’s party, even when the president is popular, which Donald Trump is not. Why make things tougher?

In a sense, this demonstrates the importance of voters and activists who are involved in Republican primaries and caucuses. Republicans have been running for federal office for four consecutive cycles vowing to repeal and replace Obamacare as their first priority. It’s been an enormously popular cause with the conservative base.

What’s more, Republicans have seen a number of their colleagues go down to defeat in primaries in recent years for not being conservative enough. Eric Cantor’s loss still echoes in the Republican caucus. Trump has threatened to support primary challengers to Republicans who oppose the health bill. As congressional districts have grown safer, members are generally less worried about general election voters than they are about those who will show up in next year’s primaries.

Besides, House Republicans likely expect that this bill won’t actually become law. Passage looks dicey in the Senate. Perhaps they hope that Trump will never sign this legislation, so voters will never experience its adverse effects and take their anger out on their elected officials. General election voters have short attention spans and don’t pay very close attention to politics and policy anyway, they might reason. Republican primary voters, meanwhile, who do pay attention and do have long memories, may just reward AHCA supporters for at least not caving to moderating pressures.

It’s a gamble, to be sure. But for many Republican members of Congress, it may seem like the safest path forward.