The militant group violently opposes the Taliban leaders of Afghanistan, where it is based. It is increasingly targeting foreign foes.