Scott Stewart at Stratfor writes:
[Obama] Bin Laden aspired to a world ruled by a Muslim caliph who would be guided by the principles of Sharia. To get there, he envisioned the establishment of a series of Islamic emirates practicing "true Islam" that eventually would expand into a global caliphate. Until his death, bin Laden maintained that jihadists should focus primarily on attacking what he termed the far enemies — the United States and its "European crusader allies." He believed that until they were driven out of the Muslim world, it would be impossible to establish such emirates because the United States and its allies would overthrow "true Muslim" leaders as they did Mullah Mohammad Omar and the Taliban in Afghanistan. Furthermore, unless the far enemies were stopped, they would continue to support the "apostate" governments, such as those in Saudi Arabia and Pakistan, that did not share bin Laden's interpretation of Islam.
Bin Laden's strategy centered on use of spectacular terrorist attacks to draw the United States into invading the Muslim world. He believed that once the United States invaded, Muslims would be compelled to join a defensive jihad to fight the "crusader armies" in a long war of attrition. Bin Laden believed that this action would lead to the collapse of the U.S. economy and government in much the same way he believed the jihad in Afghanistan had precipitated the collapse of the Soviet Union. In his plan, once the United States and its allies were defeated, local uprisings would be able to overthrow the corrupt governments in the Muslim world, clearing the way for the global caliphate to rise.
Bin Laden and al Qaeda's early attacks against the United States such as the 1993 World Trade Center bombing, the 1998 East Africa embassy bombings and the failed Millennium bombing plot did not provoke the desired U.S. response. But the spectacular 9/11 attacks certainly struck the proper chord, prompting the United States to invade Afghanistan in 2001 and topple the Taliban government. The reaction was fierce and fast, and a large number of al Qaeda and other foreign jihadists fled Afghanistan. Many settled in the friendlier confines of Pakistan's wild Pashtun areas, while some fled to other havens in the region. Abu Musab al-Zarqawi and his followers relocated to northern Iraq, a lawless region that had thrown off the yoke of Saddam Hussein's rule.
But the stricken American behemoth was not finished. In 2003, the United States invaded Iraq and toppled Saddam, who had absolutely no connection to the 9/11 attacks. This proved a boon to the jihadist cause. While Afghanistan was a relative backwater, Iraq was seen as the heart of the historical Muslim world, and therefore alluring to those wanting to fight a defensive jihad. It also helped that Iraq was wedged between Iran and Syria, two countries hostile to the United States that would aid jihadists in their efforts to bleed the United States and drive its troops out of the region.
Iraq quickly became a jihadist magnet, and as money poured in, the number of foreign fighters traveling there rapidly surpassed the number that were in Afghanistan