Terror group faced little resistance from local forces, prompting re-evaluations across a region that had sensed it might be in retreat