Last month Obama and the Republicans agreed a last minute compromise on the US national debt ceiling.
To explain why this happened, it's useful to begin by looking the peculiarities of the US political system. The US does not have a parliamentary system where the parliament elects the government. Instead, a president is elected every four years. There are elections every two years for Congress - the House of Representatives and the Senate.
The president, the House, and the Senate all have to agree to pass legislation or authorise spending. Right now the Republican Party has a majority in the House, the Democrats a majority in the Senate, and the President is a Democrat. But Senators and Representatives often don't vote with the party line. The President can also veto any bill he does not like, but he can't do anything unless Congress passes a bill.
There is a law on the books that says that Congress and the President have to regularly agree any extension of the national debt. No other country has such a law. This has been done 70 times in recent years with no fuss. This year, however, the new Republicans in the House of Representatives thought they could bully Obama into massive cuts and austerity.
The national debt is not a big problem. The government pays only 2 percent interest on its debts and the total is less than 1.5 percent of national income. But if the debt increase had not been agreed, the federal government would stop working.
Public spending works differently in America from most countries too. Much spending happens on the local and state level. Three areas account for the majority of central government ("federal") spending. These are the military, pensions for everyone ("social security") and free health care. Not everyone gets free health care, but senior citizens do ("Medicare"), and so do the unemployed poor ("Medicaid").
Social security was won in the 1930s because of a mass movement. Medicare was won by a mass movement in the 1960s. These two programmes are the heart of the American welfare state.
They have also long been the two "untouchable" areas of public spending. Public support for them is enormous. In 1993 Bill Clinton tried to get Republican senators and representatives to support cuts in Social Security. The Republicans told them not to be mad - social security was the "third rail" of American politics, like the third rail of an electric subway: touch it and you die.
This year the Republicans insisted on deep cuts in pensions and Medicare, no cuts in the military, and no tax increases. The last minute "compromise" actually cuts very little in the next year. But over ten years it provides for massive, but unspecified, cuts in Medicare and pensions. Obama praised and backed this compromise.
But the Democratic representatives were split - 90 voted for and 90 against. The 90 against reflect continuing ties to the great majority who will need pensions and health care in retirement.
This compromise has had several effects. First, it sets in stone a policy of austerity. It now seems unlikely that Obama or Congress will support government spending to stimulate the economy.
Second, liberals and union activists are turning away from Obama, some in sorrow, some in anger. Obama's calculation is that he does not have to care. He wants re-election next year. His grave weakness was that he has presided over economic disaster, and the voters are desperate for jobs. The compromise means that he and the Republicans are now partners in wrecking the economy - and the Republicans look even worse.
Third, the compromise scared the global ruling class. For fifty years the Republicans and Democrats in Washington have united solidly on key issues of economic and foreign policy at critical moments. But this time both the Tea Party Republicans and Obama looked prepared to go all the way. There seemed to be no one serious in charge. All this came at a moment when industrial production is in trouble across the world, and the European banks are in serious danger. Soon after the compromise, the credit rating agency Standard and Poor downgraded US debt - a warning to Obama and the Republicans to shape up. The Chinese official news agency publicly attacked Obama and the Republicans along similar lines and the European stock markets plunged.
In the spring, the revolt in Wisconsin was a major marker of working class rage. Although some have bought the line that the Tea Party Republicans were the "crazies", and Obama has saved the economy, many have not. Eighty percent of Americans disapprove of the way Obama is handling the economy.
For the moment, this has not led to struggle. Nor will it necessarily stop Obama's re-election. But with incomes and jobs not having recovered since the recession of 2008, there is a growing dislike for the politics of austerity, the Republicans and Obama.