When Pakistani president Pervez Musharraf shook hands with prime minister Ariel Sharon at the UN General Assembly in September 2005, Israelis hoped they were witnessing the dawn of a new era in relations between the second most populous Muslim state and the world's only Jewish one. There remain Israelis who think Musharraf's resignation on Monday "was a major loss." Others believe Musharraf simply wanted to capitalize on that handshake, along with an unprecedented address to American Jewish leaders in order to bolster his image in Washington as a Muslim moderate. He never even came close to establishing diplomatic relations with Israel. He did, however, let it be known that the Palestinian problem "lies at the heart of terrorism in the Middle East and beyond." Musharraf's analysis demands a high degree of gullibility. One would have to believe that a car bombing at an Algerian police academy which took 43 lives; the deaths of 10 French NATO soldiers at the hands Taliban guerrillas near Kabul; and a suicide bombing outside a hospital in northwest Pakistan which claimed 25 lives - all incidents that took place yesterday - were somehow attributable to the Palestinian problem. Of course, what more accurately "lies at the heart of terrorism" worldwide is the convulsive struggle now taking place within Islam itself, pitting those who want accommodation with Hindu, Christian, Jewish and other civilizations, against fanatics who demand total capitulation from the "infidels." MUSHARRAF'S departure after nine years in power contributes to an atmosphere of uncertainty. Who will replace him? What of the war on terror? Most critically, who will control Pakistan's nuclear arsenal? Pakistan is a failed state. It cannot provide for its 165 million people, 32 percent of whom live in abject poverty. The regime does not exercise control over large swaths of its territory. Washington, which has funneled $10 billion in military assistance to Islamabad only to discover that much of it was misdirected, would like to believe that Pakistan will "remain" an ally against the Islamists. It hopes bickering Pakistani politicians led by Asia Ali Zardari (the assassinated Benazir Bhutto's widower) and Nawaz Sharif will agree on a presidential successor. And it prays that the 18-member National Command Authority, mostly military types, will keep a tight rein on Pakistan's 150 nuclear warheads. Musharraf claimed that A. Q. Khan, the scientist who proliferated nuclear know-how to Iran, was a rogue actor, and Washington found it expedient to accept this explanation. Now there is talk that not only will Khan be fully rehabilitated, but he just might become the country's new president. Pakistan's military is now led by Gen. Ashfaq Parvez Kayani. He presumably also oversees the powerful Inter-Services Intelligence Agency (which he headed from 2004-2007). The ISA has a murky history of divided loyalties. In a match made in hell, it was Pakistani intelligence that first brought together Osama bin Laden and the Taliban's Muhammad Omar. Events in Pakistan are not easy to gauge and often seem incoherent. Western analysts surmise the army does not want to fight radical Muslims, preferring to save its powder for use against India. Yet in the past 11 days, not a few Pakistani soldiers have been killed fighting pro-Taliban gunmen. Meanwhile, the head of Afghanistan's domestic intelligence agency insists that Pakistan is supporting the Taliban insurgency. US intelligence officials are reportedly convinced that Pakistan helped plan the July 7 bombing of India's embassy in Kabul that killed 41 people. And the main suspects in the assassination of Bhutto are Islamist warlords with ties to the ISI. SHORTLY AFTER 9/11, then-US secretary of state Colin Powell gave Musharraf an ultimatum: "You are either with us or against us." Pakistan's leadership opted to cooperate with the West, champion moderate Islam and appease Islamist forces within the country. In a sense, Pakistan has been "with us and against us." Western observers can draw at least two lessons from the Pakistani experience. First, instability in Pakistan and Afghanistan is mostly endemic; if the Arab-Israel conflict were solved tomorrow - in its entirety - the impact on south Asia would be marginal. And second, Western leaders should stop deluding themselves about the utility of working with Muslim counterparts who cannot - or will not - deliver on their promises.