A year ago US healthcare reform seemed inevitable: no one knew whether it would include a public option (a government-backed competition with private insurers), or how much it would try to control costs, but all the smart money expected that some plan to insure America's uninsured, or at least many of them, would go through. Eight weeks ago the smart money went the other way: Republican Scott Brown's surprise election to the Senate not only killed the Democrats' Senate supermajority, but spooked already nervous Democrats in the lower house so badly that it seemed they would not, could not take the necessary votes.

And now healthcare reform is the law of the land. The president signed the underlying bill on Tuesday morning; the dignity of the ceremony was fortunately undercut by Joe Biden, who quipped, just near enough to an open microphone: ‘This is a big fucking deal.’ The White House press secretary, Robert Gibbs, endorsed the VP's verdict via Twitter: ‘And yes, Mr Vice President, you're right.’ (Will the Supreme Court overturn it? Anything's possible, but respected conservative legal minds say it's unlikely.) Reform is a big deal, not just for political parties, but for tens of millions of Americans who will have still imperfect, but far better, security if they get sick.

It very nearly didn’t happen. Both the House and the Senate passed healthcare reform in December, while the supermajority held, but the bills were not identical: the House version would never have passed the Senate and the Senate bill contained some obvious clunkers: a tax on expensive insurance of the kind that unionised coal miners, for example, really must carry, and some much-derided giveaways to individual swing senators' states (e.g. the ‘Cornhusker kickback’ for Nebraska). Most House Democrats would not have simply voted for the Senate bill: if they had, they would have got the blame for those clunkers. But they would also have been blamed if healthcare reform had failed. The White House knew that enough House Democrats might – just might – be persuaded to support the Senate bill if they could also pass a separate bill to fix its flaws, but they had first to be persuaded that this separate bill could pass the 59-Democrat Senate under a rule called ‘reconciliation’, by which budget measures require only simple majorities.

That work of persuasion has been underway for some time, and most of it could not have been done in public, since the people to be swayed were the lawmakers, whose particular hobby horses, policy preferences, scruples or local concerns had to be assuaged. The micropolitics, the back-scratching and hand-shaking and whip-counting won't be fully known for decades, but what we do know makes several people look good, among them the Speaker of the House, Nancy Pelosi. Also looking good, in the end, are most of the few dozen Congressional Democrats who oppose abortion rights, most of whom seem really to have been voting their consciences, and most of whom (even the attention-seeking Bart Stupak) came around. Stupak – who waited till 4 p.m. on the day of the vote – wanted very much to be seen as a forceful defender of foetuses, but once he had made his decision, he was a forceful defender of health for the already born: when Republicans tried to kill the House bill by amending it with Stupak's own ‘pro-life’ language, the Michigan Democrat spoke out against their move.

Had Stupak been as bullheaded as he was painted (and as he appeared to be); had Pelosi been less persuasive; had she or Steny Hoyer, the majority whip, done the arithmetic wrong; had even a handful of House Democrats from conservative-leaning districts decided to take more cautious or myopic views; had another handful of mostly Latino members not accepted assurances that their concerns about immigration would be addressed this year; had the Senate majority leader, Harry Reid, who will probably lose his seat in November, not been able to prove to enough House members that the reconciliation measure would get at least 51 votes – then healthcare reform would be as dead today as it looked on 21 January.

The president seems vindicated not only in his ideals, but in his management style. The State of the Union speech in late January, given the week after Scott Brown won Ted Kennedy's old seat, now looks like a turning point. In it Obama insisted that he would ‘not walk away’ from healthcare reform, even though (to progressives' dismay) he never specified how it was to be accomplished: he never said he would use reconciliation. Why not? He had to show the inattentive American, the ‘independent’ voter, that there was no less partisan way to get anything done.

The much-talked-about and (in policy terms) meaningless ‘healthcare summit’, televised from the White House, was the show he chose to put on, and only after the show was over could the real plan (have the House pass the Senate bill, plus a reconciliation fix) work. Designed to give the appearance of listening, the healthcare summit was also designed to give Democrat leaders in Congress time: time to count noses, time away from the news (or at least from the news about healthcare), time for the Scott Brown panic to recede, and time to convince skittish backbench Democrats to support reform, on pragmatic (failure makes all Democrats look weak) as well as on moral grounds.