ASADABAD, Afghanistan—Islamic State and the Taliban, after more than a year of fierce combat, have forged a patchwork cease-fire across much of eastern Afghanistan that has helped both insurgencies regroup and counter U.S.-backed efforts to dislodge them.

Until several months ago, Islamic State fought bloody battles with local Taliban units over fighters and territory in several provinces. The long-running Taliban insurgency has sought to stamp out its smaller rival, which only emerged in 2014. Afghan and U.S.-led coalition...