This is an Administration failure, writ large. This is what happens when a rank amateur is handed the keys to the kingdom. This is a direct result of losing two elections. The fact is, this President withdrew our military assets from Iraq some time ago, and the situation has been going downhill ever since.
In fact, a lot of intelligence resources over the past few years have predicted exactly this kind of outcome, only they did not factor in outright incompetence by the Obama Administration, and missed some of the mark because they gave too much credit where little or none was due.