The Affordable Care Act overcame the tea party protests of 2009 and the Democrats losing their filibuster-proo f Senate majority in 2010. It survived two challenges in front of the Supreme Court and the calamitous rollout of healthcare.gov.

Now it has withstood the attempt to replace it with the American Health Care Act, better known as Trumpcare.

Somehow, despite the intense political forces arrayed against it, and the mind-boggling policy problems it tries to solve, the 2010 health care law keeps defying efforts to wipe it out. That says something about the people who wrote it ― and what they have achieved.

Obamacare has never been hugely popular, and it has never worked as well as its architects hoped. Millions of Americans don’t like it and, even now, there are parts of the country where the markets are struggling to survive. But the program has provided security and access to care for millions of others. More importantly, it has shifted the expectations of what government should do ― and of what a decent society looks like.

This week’s defeat of the Republican repeal effort shows just how hard it is to undo those changes. And it won’t get any easier.

What Obama And Pelosi Did (And Trump And Ryan Didn’t)

On Friday, hours before President Donald Trump and House Speaker Paul Ryan (R-Wis.) formally conceded their bill lacked the votes to pass, White House press secretary Sean Spicer signaled what was coming. Trump, he said, had “left everything on the field.”

The statement was preposterous.

Trump and the Republicans in Congress had spent all of 63 days trying to pass their Obamacare repeal ― less than three weeks of which were spent actually debating the text of the AHCA. They held votes before Congressional Budget Office evaluations were ready, and were about to ask the full House to decide on the proposal just hours after making major changes to it.

Over in the Senate, Majority Leader Mitch McConnell (R-Ky.) had already indicated he intended to bypass his committees altogether and take legislation directly to the floor ― perhaps with a quick House-Senate negotiation, a fast vote and a signature from the president.

By contrast, it took former President Barack Obama, former House Speaker Nancy Pelosi and former Senate Majority Leader Harry Reid (D-Nev.) more than a year to pass Obamacare ― a politically tortuous period that many people later blamed for Democrats losing their House majority in 2010.

At the time, every apparent error loomed large ― from taking on health care at all, to letting the process drag out for more than a year, to slavishly crafting a proposal as CBO specified, to cutting unpleasant deals with health care’s special interests.

Lost amid the recriminations was the talent each player brought to his or her task ― and the Democrats’ single-minded focus on avoiding mistakes of the past in order to achieve something their party had been trying to do since the days when Franklin Roosevelt was in the White House.

I am not saying we needed 14 months to do this. But I think a more careful and deliberate approach ... would have gotten us further down the path to a solution. Sen. Tom Cotton (R-Ark.)

The work had begun long before Obama even ran for president. In the aftermath of the defeat for Bill Clinton’s 1994 health care plan, activists, advocates and intellectuals regrouped ― and then spent literally years hashing out their ideas for achieving universal coverage in a politically viable way. When Obama did run, he borrowed their work for his own plan. When he was elected, the most pivotal committee chairman of the process, Senate Finance Chairman Max Baucus (D-Mont.), was ready with his own blueprint that looked nearly identical.

Baucus had done something else: Working with then-Sen. Ted Kennedy (D-Mass.), he had convened meetings with virtually every health care stakeholder, from hospitals to unions to insurers to patient advocacy groups, exchanging ideas and negotiating over principles. It meant that when the actual legislating started, the channels of communication were already open and the groundwork for a common vision was already in place.

And still it was a nearly impossible task. Like the Republicans this year, Democrats found consensus difficult to achieve ― among the outside groups, and within their own ranks as well. Liberals wanted a more generous program, and a public option. Moderates wanted to avoid too much government spending and too much meddling with the way independent businesses operate.

But unlike the Republicans, the Democrats’ reaction was to work with the different groups and slowly bring them along ― most vividly, by negotiating with a handful of moderate Republicans, in the hopes that one or two (or maybe more) would sign onto the plan. It never happened, but the effort to woo those members helped secure moderate Democrats who needed to tell their constituents that, yes, they had tried to be bipartisan.

One reason Democratic leaders were able to preserve legislative momentum was that they understood, at all times, where they were trying to go ― and they were fluent enough in the policy to handle direct negotiations on their own. One of the enduring images of Obama during the Affordable Care Act fight was his visit to a Republican Party policy retreat in Baltimore, where he fielded questions and parried criticisms from the assembled members for roughly 90 minutes.

The work that led to Obamacare had begun before Obama even ran for president.

Trump, by contrast, seemed to lack anything beyond a superficial understanding of the bill, to the point where allies worried about letting him negotiate details. “Either doesn’t know, doesn’t care or both,” a Capitol Hill aide told CNN about the president.

As for Pelosi, her job was easier than Ryan’s in one important sense. Nobody in her caucus was as extremist or nihilist as the Freedom Caucus, partly because Democrats had done so much prep work and hammered out a rough consensus before the hard legislating work began.

But Pelosi didn’t try to jam through “slapdash” legislation, as Harold Pollack, writing in Politico, recently called the AHCA. And she didn’t flinch when her political task looked utterly hopeless.

When Kennedy’s seat went to Scott Brown, depriving Democrats of a filibuster-proof majority to approve a final compromise, she told Obama she would get the votes for the Senate’s bill ― and she did, taking charge of the whip count personally ― and working her caucus, one member at a time, until she had a majority.

On Sunday, during an appearance on CBS’s “Face The Nation,” Sen. Tom Cotton (R-Ark.), conceded that maybe the Democrats knew what they were doing.

“When the Democrats came to power in 2009, for 60 years at least, they had been pursuing a national health care system, yet they didn’t introduce legislation for eight months, and they didn’t pass it for over a year of Barack Obama’s first term,” Cotton said.

“I am not saying we needed 14 months to do this,” he added, “but I think a more careful and deliberate approach, which we now have time to do because we are going to have to revisit health care anyway, would have gotten us further down the path to a solution.”

Alex Wong via Getty Images Former President Barack Obama signs the Affordable Health Care for America Act on March 23, 2010. The historic bill was passed by the House of Representatives after a 14-month political battle that left the legislation without a single Republican vote.

The Resilience Of Obamacare

But the Republican failure wasn’t just about process. It was also about policy ― and a failure to realize just how profoundly the Affordable Care Act has changed public expectations for how the U.S. health care system operates.

The end product of that long, cantankerous debate in 2009 and 2010 wasn’t pretty. Keeping the health care industry on board meant heeding their demands to ratchet back aggressive cost controls. Holding moderate Democrats in the coalition meant putting a tighter lid on what the program would spend. Passing the Senate bill meant accepting statutory language that its authors had hoped a conference committee would clean up before enactment.

These compromises and concessions made implementation difficult. The sloppy language from the Senate bill exposed the program to the lawsuit King v. Burwell, which, if successful, would have destroyed the exchanges. The deals to secure support from individual members, like the “cornhusker kickback” that helped reel in Sen. Ben Nelson (D-Neb.), stained the whole effort with a tinge of corruption. The stingy funding meant that some middle-class people wouldn’t get much financial help, despite high premiums.

Republicans proved exceptionally adept at turning these problems into political advantages. But more frequently than not, they attacked the law because it wasn’t living up to liberal ideals ― because it left middle-class people on the hook for premiums, or because the plans had onerous deductibles, or because it was insufficiently harsh to the health care industry. McConnell was fond of pointing out that the law had left some 25 million people uninsured.

The message was unmistakable: The health care law had failed because it had made health care harder for people to get, and the GOP had a better way.

These arguments helped Republicans grab and hold congressional majorities, and they helped put Trump in the White House. But McConnell wasn’t interested in covering more people any more than Ryan wanted to lower people’s deductibles. And the need to write legislation exposed their real policy preferences ― which were lower taxes, fewer regulations and less government spending on the poor.

The combination meant that more people, not fewer, would be exposed to crippling medical bills. When the CBO finally did weigh in, the number of people predicted to lose their insurance, 24 million, was so big that even Republicans couldn’t spin or lie their way out of it.

“All politicians overpromise,” Jonathan Chait, of New York magazine, observed. “But the Republicans did more than overpromise. They delivered a policy directionally opposed to their promises.”

Republicans had also convinced themselves that nobody who had insurance through the Affordable Care Act liked it. The media coverage made it easy to believe this. Stories of people losing their old plans or paying more for new ones were all over the press for the first few years of the program. Stories of people saving money, or getting insurance for the first time, were much harder to find.

Joshua Roberts / Reuters President Donald Trump waves with Speaker of the House Paul Ryan (R-Wis.) earlier this month. The health care bill they proposed to repeal and replace the Affordable Care Act died this week.

But as surveys showed, the majority of people getting coverage through the Affordable Care Act were actually satisfied with it ― and quite a few were deeply grateful. In the last few months, finally, their stories became part of the conversation. They showed up on television, in the print media, and especially at town hall meetings ― forcing Republicans to answer questions they’d successfully dodged for years by tapping into anger with “Obama” and glossing over details about the “care.”

“If it wasn’t for Obamacare, we wouldn’t be able to afford insurance,” an Iowa farmer told Sen. Chuck Grassley (R-Iowa). Recalling Grassley’s 2009 false warning that the Affordable Care Act had “death panels,” the farmer said, “With all due respect, sir, you’re the man that talked about the death panel. We’re going to create one big death panel in this country if people can’t afford insurance.”

At a CNN town hall, in front of a live national audience, an Arizona man with cancer told Ryan that the health care law was paying for his cancer treatment. “I want to thank President Obama from the bottom of my heart because I would be dead if it weren’t for him,” the man said, adding that he was a Republican who once opposed the law and had volunteered in GOP campaigns.

The backlash left Republicans visibly rattled. And although leaders tried to write off such incidents as paid activists making trouble, they couldn’t explain why nearly every group connected to health care ― from the American Medical Association to AARP ― was making the same arguments.

Nor could Republicans explain plummeting public support for the legislation. By the end, the GOP bill had support from just 17 percent of the population ― much less than Obamacare, at its worst, ever polled.

Depriving people of health insurance because they have a pre-existing condition is no longer acceptable.

Up until the end, Republicans had the votes to pass the House bill or something like it, and deliver Trump the big win he craved. It’s not so difficult to imagine a scenario with slightly better leadership, and slightly less obstreperous Republican factions, in which the legislation would have gone through both chambers and eventually to the White House.

But doing so would have almost surely produced a massive political backlash, because taking health insurance away from millions of people ― depriving people of health care because they have a pre-existing condition, or because they don’t have enough money to pay for it ― is no longer acceptable.

It was the status quo until 2010. That was seven years ago and there is very little enthusiasm for going back.

As Sen. Bill Cassidy, a conservative doctor who represents the conservative state of Louisiana, told The New York Times, “There’s a widespread recognition that the federal government, Congress, has created the right for every American to have health care.”

What Happens Now

Obamacare remains a shaky enterprise, with markets in several states down to two or even one insurance company. And Trump, who has already taken some actions to sabotage the program’s performance, might make it even a shakier.

“Bad things are going to happen to Obamacare,” Trump said from the Oval Office on Friday, making what sounded to a lot of people like a threat. “There’s not much you can do to help it.”

Nobody questions that Obamacare requires reinforcement and repair ― or that someday it might need total replacement. Conservatives and liberals each have plenty of ideas along those lines.

But the standard for judging any of these proposals, or some bipartisan combination of them, will be the same one that Trumpcare failed to meet: Does it protect the people who need protection? Does it improve access to care? Does it reduce financial insecurity? Does it move the U.S. closer to a system where all Americans truly have a way to get the medical care they need ― at a price they can afford?

This, in the end, is what Obama, Pelosi and their allies achieved with the Affordable Care Act ― not the creation of a jury-rigged system of regulations and tax credits, or the expansion of an overtaxed Medicaid program, or any of the myriad smaller policy initiatives the Affordable Care Act. The true legacy of Obamacare is the principle that everybody should have health insurance.

Erasing that is not something that can happen in 63 days. And it may never happen at all.

Sign up for the HuffPost Must Reads newsletter. Each Sunday, we will bring you the best original reporting, long form writing and breaking news from The Huffington Post and around the web, plus behind-the-scenes looks at how it’s all made. Click here to sign up!