What does America’s disastrous bombing of Pakistani soldiers this week have to do with President Obama’s much-ballyhooed trip to East Asia last week? Between them, they suggest that the Obama administration may be, finally, edging toward a foreign-policy doctrine.

First, Pakistan. The bombing was a mistake, but it comes after a series of very conscious decisions—most significantly the assassination of Osama bin Laden—in which Obama put killing al Qaeda terrorists ahead of America’s relationship with Pakistan. That’s not the tradeoff many expected when Obama came into office determined to eschew unilateralism, reinvigorate diplomacy and improve America’s relationships with the Muslim world. But it makes sense when you realize that the Obama administration has largely given up on trying to remake Pakistan and Afghanistan.

As Bob Woodward’s Obama’s Wars made clear, Obama never considered the Taliban a real threat to American security. And after giving Gen. David Petraeus and company a chance to try counterinsurgency, Obama is increasingly pursuing the policy that Vice President Joe Biden proposed from the beginning: leave Afghanistan to the Afghans and keep al Qaeda off balance with Special Forces and attacks from the air.

Indeed, as the U.S. withdraws its ground forces from Afghanistan and Iraq, the centerpiece of its military policy in the Muslim world is becoming drones to attack al Qaeda (the Washington Post recently reported that the Obama administration is building secret drone bases in the Arabian Peninsula and the Horn of Africa) and military aid to contain Iran (last fall, the U.S. and Saudi Arabia agreed on the largest weapons sale in American history).

One way of understanding America’s shifting policy in the Middle East is that we’re moving offshore. Instead of directly occupying Islamic lands, we’re trying to secure our interests from the sea, the air and by equipping our allies. That’s in large measure what the Obama administration is trying to do in East Asia, too. The central message of Obama’s trip last week to Australia was that the U.S. finally is focused on restraining China’s rise in the Pacific. And how will the U.S. do that? A token deployment of Marines in northern Australia notwithstanding, the Obama administration’s strategy will be to buttress America’s naval presence in the Pacific and aid those nations on China’s periphery that fear its hegemonic ambitions.

There’s a name for the strategy the Obama administration is increasingly pursuing from the Persian Gulf through the Hindu Kush to the South China Sea: offshore balancing. It’s the idea that America can best contain our adversaries not by confronting them on land, but by maintaining our naval and air power and strengthening those smaller nations that see us as a natural counterweight to their larger neighbors.

The strategy has deep roots in America, a nation rich in technology and naval power but highly sensitive to casualties. When World War II broke out, Franklin Roosevelt at first tried to make America Britain’s quartermaster. Then, when forced to directly enter the fray, he initially hoped to limit America’s participation in the European theater to air and naval support while the Russians and Brits fought Germany on land. After the war, George Kennan’s original vision for containing the U.S.S.R. was similar: aid the ravaged nations of Japan and Western Europe so they could resist the Soviets on their own, and patrol the seas.

When America’s leaders are flush with money and confident in America’s military might, off-shore balancing goes out the window. That’s what happened in 1950, when the Truman administration—against Kennan’s warnings—went to war in Korea and signed NSC 68, which dramatically increased U.S. military spending and laid the groundwork for Vietnam. It’s also what happened when the Bush administration—buoyed by America’s victories in the Gulf War, Bosnia and Kosovo—responded to 9/11 not by offering counterterrorism cooperation to America’s allies or by launching air strikes, but by invading two Muslim nations.

Offshore balancing, by contrast, reemerges when the money and bravado have run out. After the trauma of Korea, Dwight Eisenhower tried to use the U.S. Air Force—now outfitted with nuclear weapons—to deter the Soviet Union so the U.S. wouldn’t spend blood and treasure battling communism on the ground. Richard Nixon withdrew U.S. ground troops from Vietnam and launched ferocious bombing from the air while sending vast quantities of weaponry to governments such as Iran’s in the hopes that they could contain the U.S.S.R. while the U.S. stayed offshore.

Now, Obama is doing something similar in the wake of a land-based war on terror that America manifestly cannot afford. Offshore balancing has its drawbacks. It requires abandoning the idea that via nation building the U.S. can remake other societies, and often involves partnering with smaller nations with which America faces a common enemy—the Gulf States against Iran, Vietnam against China—regardless of our allies’ democratic credentials.

For an Obama administration that came into office talking about remaking the world’s institutional architecture to combat common threats like global warming and nuclear proliferation, offshore balancing seems a bit amoral and zero-sum. But it offers a way for the U.S. to maintain influence at reduced cost, which is likely to be the central foreign policy challenge of the next few years. And it offers a way to distinguish between vital national interests, such as preventing China from shutting the U.S. out of East Asia, from non-vital ones, like who rules Afghanistan. Given the staggering cost the U.S. has paid for its inability to make those distinctions over the last decade, Obama’s new doctrine isn’t coming a moment too soon.