I suspect it's several things, including luck, al Qaeda alienating all their dangerous geeks, and a lot of military and police action.
Why not luck? We had awful luck on 9/11 -- there were many ways the attacks could have failed. Luck can be good too.
Slate asks the question of "experts": Why hasn't America been attacked since 9/11? - By Timothy Noah.