Max Fisher in The Atlantic:
Neither the Pakistani military nor General Kayani have been much in the way of friends to America. As recently as January 2008, Kayani quietly brokered ceasefires with Taliban leaders such as Baitullah Mehsud, whose agreement with Pakistan allowed him to focus on fighting the U.S. in Afghanistan. Chairman of the Joint Chiefs of Staff Admiral Mike Mullen pleaded with Kayani, but he refused to budge. (The ceasefire later collapsed; Mehsud was killed last August by a CIA drone strike.) That July, according to Pakistani journalist Ahmed Rashid's Descent Into Chaos, Mullen confronted Kayani with evidence that the military's CIA-like Inter-Services Intelligence (ISI) was supporting a particularly vicious Taliban leader named Jalaluddin Haqqani who was ravaging American forces. Again, Kayani refused Mullen's request to reign in the ISI, which he had once headed. (Just four months ago, Secretary of State Hillary Clinton accused the ISI of tolerating al-Qaeda's presence.) In September 2008, when U.S. special forces launched their first operations inside Pakistan, Kayani was outraged. He promised the American troops would be shot on sight.
What changed? Barack Obama's election and his subsequent escalation of American involvement in Afghanistan changed the calculus for Kayani. Obama's emphasis on Afghanistan's civil society and long-term political stability, a focus some have criticized as nation-building, also happen to finally bring America's interests in line with Kayani's.
More here.