The increased engagement follows the U.S.’s decision last year to widen the military’s authority to conduct offensive operations in Afghanistan amid gains made by the Taliban, its largest insurgency, and Islamic State’s affiliate in the country.