If I were a conspiracy theorist, I would say that Osama bin Laden was a Chinese agent. And maybe America's banks, credit card companies, advertising agencies and government have been secretly working for China too. For while the United States has spent more than $1 trillion on foreign wars since the 9/11 attacks, and piled up a Mount Everest of debt at home, China has spent the last decade quietly growing, saving, investing and rising. If the winner of the war in Iraq was Iran, the winner of America's decade-long struggle against violent Islamism may be China.

The good news is that America is waking up to its predicament. President Obama talks of the need for nation-building at home. Richard Haass, head of the Council on Foreign Relations and once a member of the Bush administration, reflects on "a decade of strategic distraction". A veteran Republican observes that the US is building more infrastructure in Afghanistan than in America. (The road surface of the interstate highways seems to get worse every year I come back.) Every second newspaper column now points up the contrast between China's high-speed intercity rail links and America's lack of them. Former national security adviser Zbigniew Brzezinski calls for a programme of "national renewal". Everyone acknowledges that performance in the lower half of America's school system is dismal.

And that's before we even mention the alarmingly sluggish recovery of the economy, the loss of jobs, the scale of the soaring deficits. Looking at the Congressional budget office's projections, Republican Senator John Ensign says that if they don't do something about it, "this country is going to become Greece, except we don't have the European Union to bail us out". One of the country's most senior military figures was asked, not so long ago, what he considered to be the greatest single national security threat to the US. His answer: our national debt.

This does not mean that the danger from Islamist terrorists, or a nuclear-threshold Iran sparking a nuclear arms race in the Middle East, or the festering sore of the unresolved Israeli-Palestinian conflict, are not real or important. They are. But if you ask what will be the biggest geopolitical story of the 2010s, my best guess is "rising China and struggling America". Where that competition has got to by 2020 will depend crucially on America's ability to put its house in order. Physician, heal thyself.

If you want to feel optimistic about America's chances of renewal, go to Silicon Valley. For a downer, look to Washington. The struggle for America's recovery is the battle of the iPad against the filibuster. In Silicon Valley, just down the road from where I write this, you see everything that is still inspiring about American society: innovation rooted in science and intellectual freedom; entrepreneurs and risk-taking venture capital exploiting that innovation commercially; a dynamic, open society that attracts the brightest from everywhere – Indians, Chinese, Europeans. If you ask people around the world what they most admire about the US, their shortlist is likely to include, beside George Clooney and Julia Roberts, the iPhone, Facebook, Twitter or Google.

But switch on your television, or turn to the politics pages of your newspaper, and your heart sinks. What is it that makes American politics so depressing? They are both polarised and gridlocked. Change in Silicon Valley happens at the speed of science fiction; in Washington, at the pace of Brezhnev's Soviet Union.

For instance, a bill to help out America's job-generating small businesses with modest government-backed loans was stuck in the Senate for months – a victim of the procedural rule which means that the minority (currently Republican) can block legislation by the threat of filibuster unless the other side can garner a 60-vote "supermajority". Only when two Republican senators supported it could the small business bill come to President Obama for signature. He was finally able to start the job-promoting loans flowing this week. As the outstanding conservative commentator David Brooks observes, a growing number of Americans believe that their political system is dysfunctional.

There are several aspects to this dysfunctionality. There is what I call the politics of cultural distraction. Millions of air hours are devoted to arguments about gay marriage, abortion, homosexuality or, most recently, the planned Islamic centre two blocks from Ground Zero in New York. Increasingly, these resemble arguments about which tune the band should play on the deck of the Titanic. ("Let the good times roll"? "Nearer my God to thee?" Glug, glug, glug.) Although the Tea Party movement adds to the craziness, at least it spends more of its time talking about problems in the engine room.

Then there is the strident, partisan polarisation of the cable news networks, with Fox News roaring from the right, MSNBC shouting back from the left, and CNN flailing in the middle.

There is the way in which money howls through American politics. To get re-elected is hugely expensive, and members of the House of Representatives have to do it every two years, so they are constantly beholden to their donors. Following a perverse recent ruling by the supreme court, corporations can now effectively throw unlimited money at political advertising.

There is the shameless gerrymandering, politely called "redistricting". At a recent event organised by Google, a former chair of the Republican national committee, Ed Gillespie, calmly explained that winning control of local houses of representatives in individual states is also important, because it helps when it comes to "being able to draw the district lines in a way that is more favourable toward your party". Not even the pretence that democracy is meant to have a level playing field.

All these exacerbate the dysfunctionality. But the most immediate, pressing problem is the combination of institutional gridlock and the lack of cross-party co-operation, each reinforcing the other. The comedian Stephen Colbert was recently, and controversially, invited to testify to a Congressional committee on the position of immigrant farm workers. In his peroration, he said: "I trust that, following my testimony, both sides will work together on this issue in the best interests of the American people – as you always do." That got the biggest laugh of the day.

Current projections suggest that in the midterm elections on 2 November, Republicans will take control of the House of Representatives but not quite win a majority in the Senate. On present form that would mean still more gridlock and Brezhnevite delay. But the US can no longer afford that. It cannot go on like this. Or rather it can, but if it does, it must continue its relative decline – and China will be laughing all the way to the bank.

These are not huge changes of the whole political system that are called for. Cross-party co-operation to simplify the country's absurdly complicated tax code, redirect the budget to the needs of nation-building at home, limit the power of money in American politics, and change the rules of procedure in the Senate – that would already get you a long way. But in 2010, one of the questions of this decade is plainly posed: can the United States be reformed?