In one respect, the president's visit to Afghanistan was a surprise: few people knew about it, and even those who did know kept their mouths shut. But from every other angle of analysis, it was a set-piece exercise, planned long in advance and rehearsed with care. There was plenty of criticism from the opposition and dissection in the media, with observers discussing the future of Afghanistan in light of the new, long-term pact with the United States, but the reality is that the future of the place is largely out of our hands.

Many will recall that the re-deployment of American troops from Afghanistan has been an aim of the administration since before it took office. The surge in places like Kandahar and Helmand were only to aid the eventual withdrawal, and the plans have been in place for quite some time. The administration's policy in Afghanistan has not been a work in progress. Instead, the White House started with the objective of leaving---strategically reasonable in light of the intractability of the region and our lack of political will---and then developed the tactical plans to withdraw.

The announcement that the agreement with Kabul will last until the year 2024 has given some pause to those who believed that we would be largely out of Afghanistan perhaps by the next mid-term election and surely by the general election in 2016. That we anticipate having in Afghanistan Americans who are now in middle school seems like a screaming headline. We will withdraw our forces, and quickly, too, but they will be conventional troops. Special Forces, special operations forces and trainers will remain behind, and although Afghan troops will conduct plenty of military operations, those that include air support will have Americans on the ground. We will not be ceding control of American air assets to the Afghans, no matter how long we plan to stay.

The Pentagon's public confidence and our military's training efforts aside, nobody has any real expectation that the Afghans will be able to keep the Taliban at bay for an extended period, but if it does, success will come in spite of---not because of---the inept, corrupt central government. There will be victories, and some may be stunning, but they will be local and probably fleeting.

There has been plenty of criticism of the timing of the president's trip, but we're talking about politicians, and their stock in trade is symbolism and criticism. Much sillier is the grousing about the decision to launch the raid during which Osama bin Laden was killed. It is not correct that just about anybody would easily have concluded that a raid was the proper course of action, and indeed exactly the opposite is true.

Whatever else can be said for or against President Obama's policies, his decision was extremely difficult, contrary to the advice of many of his advisors, and risky in the extreme. A successful raid was determined to be beneficial to his presidency, to be sure, but he was advised that if the mission were unsuccessful it would be an unmitigated military, diplomatic and political disaster, with dead and captured Americans in the hands of Pakistan's ISI. Many, including the the Secretary of Defense, advised a kinetic strike, destroying the compound, a course of action with little attendant risk. But destruction of the compound meant destroying any information of intelligence value as well.

In the event, one helicopter was damaged when a rotor blade hit the compound wall, and the aircraft had to be destroyed prior to the team's extraction. But the Pakistanis did not intervene, either because they were inept or because our electronic counter-measures were effective, and we collected a massive amount of actionable intelligence. We have been using this information to tremendous advantage, and it will continue to be valuable for a long time to come.

Nevertheless, we're leaving Afghanistan. The trainers and special operations troops we leave behind will do much good work with the Afghans in the next few years, and some Afghan units will become quite proficient, but none of this will matter. The government and police will continue their corrupt practices, Kabul's influence among the people will not increase, and the benighted Afghans will continue to live pretty much as they did a millenium ago.