Mody Torres of Select Energy Services monitors water tanks at a Hess fracking site near Williston, North Dakota November 12, 2014. (Andrew Cullen/Reuters)

Two-thirds of Americans believe the country is on the wrong track, a poll number that has not shifted much in three years. The midterm election results were just another reflection of this pervasive discontent. And yet, looking at the rest of the world, what’s striking is how well the United States is doing relative to other major economies. Japan is back in a recession and Germany has barely avoided slipping into one, which would have been its third since 2008. President Obama says the United States has produced more jobs in its recovery than the rest of the industrialized world put together.

Why is this? Many believe that the American economy has some inherent advantages over its major competitors — a more flexible structure, stronger entrepreneurial traditions and a more demographically vibrant society. Along comes a fascinating new book that says you ain’t seen nothing yet.

Peter Zeihan’s “The Accidental Superpower” begins with geography, pointing out that the United States is the world’s largest consumer market for a reason: its rivers. Transporting goods by water is 12 times cheaper than by land (which is why civilizations have always flourished around rivers). And the United States, Zeihan calculates, has more navigable waterways — 17,600 miles’ worth — than the rest of the world. By comparison, he notes, China and Germany each have about 2,000 miles. And all of the Arab world has 120 miles.

But that’s just the beginning. “The world’s greatest river network . . . directly overlies the world’s largest piece of arable land, the American Midwest.” Add to this deep-water ports, which are needed to get goods to and from the rest of the world. Many countries with long coastlines have very few natural harbors. Africa, for example, Zeihan says, has “only 10 locations with bays of sufficient protective capacity to justify port construction.” The U.S. contrast is, again, striking. Puget Sound, San Francisco Bay and the Chesapeake Bay are the world’s three largest natural harbors. The Chesapeake Bay alone “boasts longer stretches of prime port property than the entire continental coast of Asia from Vladivostok to Lahore,” Zeihan writes.

All of these factors have created the world’s largest consumer market, which in turn creates surplus private savings and a dynamic, unified economy that is remarkably self-sufficient. Imports made up just 17 percent of the U.S. economy in 2012, according to the World Bank, compared with Germany’s 46 percent and China’s 25 percent — and the U.S. number will fall as the United States imports less foreign oil.

Many people have argued that the United States’ energy revolution will give it great economic advantages. Zeihan agrees but emphasizes the degree to which this strength will insulate the United States from the rest of the world. For most of modern history, the vital sources of energy (in the Middle East) lay far away from the centers of economic production (in Western Europe and North America). But now, thanks to shale and tight oil, North America has much of the energy it needs at home. It has less need to police sea lanes in the Persian Gulf, a task that now mostly ensures the safe passage of oil from Saudi Arabia to China.

For Zeihan, oil was one big reason the United States needed to be involved with the world. As the world gets messier, he argues, there are fewer compelling reasons for the United States to pay with blood and treasure to stabilize it. In a sense, Zeihan sees some of the same international disorder that Bret Stephens does in his spirited new book, “America in Retreat.” But Zeihan would argue that its cause is not Obama’s weakness but the nation’s logical return to its traditional, pre-1945 strategy, to prosper far from the ills of the world.

I am not as sure as Stephens or Zeihan that the rest of the world is going to hell. And I’m not as sure as Zeihan that the United States’ advantages are chiefly structural. Looking at the past five years, again in comparative terms, American public policy actually comes out looking impressive. To combat the global economic crisis of 2008, Washington acted speedily and creatively in three ways: through aggressive monetary policy, aggressive fiscal policy, and aggressive reform and recapitalization of the banking sector. Every other rich country did less and has seen a more troubled return to normalcy.

Since the response to the financial crisis, Washington has been paralyzed and polarized. But this is not the entirety of American politics. Beyond the Beltway, mayors and governors are reaching across party lines, partnering with the private sector, and making reforms and investments for growth. When Alexis de Tocqueville wrote about the country in the 1830s, he was struck by the bottom-up vitality of its towns and villages. This genius of the United States is still alive, whatever most Americans think.