The problem was that too many terrorist resources were being poured into Iraq, where the main result was the loss of many terrorist leaders and specialists, and even more innocent Iraqi civilians. That led to a loss of popularity throughout the Moslem world, and even fewer recruits and contributions. While al Qaeda still has some popular support, the organization itself has been reduced to a few hundred members hiding out among Pushtun and Baluchi tribes in Pakistan.
Remember, too, that far from being a training ground for terrorists, Iraq was a killing ground. And those who escaped went home telling tales of woe. Remember that to maintain their dignity they have an incentive to inflate the power of America and the depravity of al Qaeda to explain why they did not die a glorious death in the jihad.
We've won the real battle against al Qaeda in Iraq. Now we need to pursue them into Pakistan.