On Friday, not with a final stand but with an ignominious retreat, the modern Republican party died. Speaker of the House Paul Ryan had to pull the Republicans’ repeal of America’s Affordable Care Act before members of his own party killed it. That legislative defeat was the moment Republican ideology engaged in its first real battle with reality, and reality won. The Republican party can never again be the same.

Since 1980, Republican leadership has embraced the draconian goal of dismantling the New Deal state. When Democrats under Franklin D Roosevelt put in place policies to regulate business and finance, protect workers, and provide a basic social safety net in the hope of preventing another Great Depression, a reactionary rump of pro-business Republicans howled.

Government efforts to maintain a level economic playing field among Americans amounted to socialism, they said, because regulations and the taxes necessary to fund welfare policies infringed on individual liberty by redistributing wealth from the rich to the poor. This argument was initially limited to a small group of naysayers but, by 1980, this was the ideology that drove the Republican party. In 1980, newly elected President Ronald Reagan warned that “government is not the solution to our problem; government is the problem”, and the party devoted itself to tax cuts, planning to starve the government to death.

But the stark ideology of the Republicans calling for a return to the pro-business government of the 1920s never reflected political reality. The policies Republicans loathed were actually quite popular. So, to garner support for their attack on an activist government, they turned to a mythological narrative that drew on America’s long history of racism and sexism. They won voters not by convincing them of the merits of returning to a world in which businessmen ran the country, but rather by insisting that taxes redistributed wealth from hardworking white people to lazy minorities and feminists who wanted abortions on demand.

Their narrative was simple. Hardworking white Christian men were under attack by a behemoth government, designed by Democrats, that sucked them dry with high taxes funnelled to poor minorities and grasping women, who, in turn, supported Democrats for the government goodies they provided. This narrative of the individual under attack by an empire – the same storyline that drove the 1977 hit film Star Wars – worked. Voters rallied to Reagan’s attacks on an apocryphal Welfare Queen, a black woman who had become rich by collecting welfare cheques under 80 different names, and thrilled to his promise to protect regular Americans from the taxes that supported such parasites.

But while white men ever since have embraced the heroic idea that they were independent individuals under attack by a government that catered to minorities, the reality has always been that Americans actually believe that the government has a key role to play in business regulation and social welfare.

Republicans have been able to paper over the vast gulf between their ideology and reality, so long as they could blame Democrats for their inability to put their ideology into law. They could rail about lower taxes and liberty, and then, when Democrats saved the policies that voters liked, could blame the socialistic Democrats for Republicans’ own failure to enact their ideological vision. This tactic was at the heart of their rage against Obamacare, the symbol of their oppression since it passed seven years ago. Republicans in the House of Representatives voted more than 50 times to repeal the law, knowing they could count on Obama’s veto to protect them from voters who would, in reality, be furious at the loss of their healthcare.

But the installation of the Trump administration in Washington marked the moment of reckoning, when Republicans had to face the gulf between their rhetoric and reality.

Suddenly in control of both Congress and the White House, Republicans had to stop carping and start delivering. President Trump vowed to begin by overturning Obamacare on day one, promising that the process would be “easy”.

It was not. The initial draft of the bill reflected Republican ideological principles by giving the wealthiest Americans an $880bn tax cut. Even still, its retention of government regulations on healthcare were too much for purists. Members of the far-right Freedom Caucus insisted that the government must not interfere in healthcare, defending the principle that the law must be repealed entirely to resurrect American liberty. Other members of Congress, swamped by popular outcry against repeal, had to bow to reality: Americans actually like the law.

The showdown over Obamacare finally brought into the open the fundamental rift between Republican ideology and reality. Speaker Ryan and President Trump tried to skirt that gulf by forcing the bill through in an astonishing 17 days. When that failed, Trump tried to bluster it out with the old Republican narrative, blaming Democrats, who are in the minority, for this epic failure. Neither worked. Since 1980, the Republican party has won power by hiding its unpopular ideology under a winning narrative, and reality has finally intruded.

Heather Richardson is professor of history at Boston College