An Afghan soldier guards the site of an attack near the Marshal Fahim military academy in Kabul on Jan. 29. (Wakil Kohsar/AFP/Getty Images)

Last April, the U.S. military set out to take on the Islamic State in Afghanistan. At the time, officials estimated the group had about 700 fighters in the country. The U.S. forces seemed confident they could extinguish the Islamist militants.

The United States targeted the fighters with the “mother of all bombs,” which was dropped on caves in Afghanistan last spring. By June, the U.S. military said it had killed Abu Sayed, the head of Afghanistan’s Islamic State affiliate, in an airstrike. A Pentagon spokeswoman predicted that the strike would “significantly disrupt the terror group’s plans to expand its presence in Afghanistan.”

That hasn't come to pass.

In the months since, the terrorist organization has launched several high-profile attacks in Kabul and beyond. In December, the group claimed responsibility for a suicide bombing at a Shiite cultural center that killed 41 people. That month, Islamic State attackers stormed two different Afghanistan intelligence service locations in a week. In January, a handful of gunmen claiming to be members of the Islamic State held up a Save the Children office in Jalalabad, killing four people in an hours-long siege.

And Wednesday, a suicide bomber detonated explosives near a major Shiite shrine in Kabul, killing dozens during celebrations of the Persian new year.

No one thinks the Islamic State is as powerful as the Taliban or that it might take control of significant swaths of Afghanistan as it once did in Iraq and Syria. But the group, also known as ISIS, still has the potential to wreak plenty of havoc. Here's a look at how the Islamic State won a foothold in Afghanistan, what it wants and whether it's succeeding.

How long has the Islamic State been in Afghanistan?

It’s hard to say, but U.S. officials started to hear rumors about the group operating in Afghanistan around 2014.

James Cunningham, who was the U.S. ambassador to Afghanistan at the time, told Frontline that the group was using Afghanistan and Pakistan as a recruiting ground, trying to find fighters who would travel to Syria and Iraq.

But the Islamic State's high profile attracted dissatisfied members of the Taliban and other insurgent groups who were eager for a rebrand. They were drawn to the Islamic State, journalist Anand Gopal told Frontline in 2015, because of the attention it was getting in the media: “There’s been increased dissatisfaction among certain elements of the Taliban, and with the media talking about ISIS all the time and the Afghan government playing up the idea of ISIS as a way of keeping the United States interested, all of that sort of set the ground for the groups to rebrand themselves.”

It's not clear that there was ever much communication between the Islamic State in Afghanistan and key leaders in Syria and Iraq. The Afghanistan branch was more like a franchise, operating largely independently. “They embrace the label, and they swear allegiance to Baghdadi, but it doesn’t appear there is any direction, control or instructions coming from Syria, Iraq or Baghdadi,” Vanda Felbab-Brown, a senior fellow at the Brookings Institution, told Frontline. She referred to Islamic State leader Abu Bakr al-Baghdadi.

What does the Islamic State in Afghanistan look like today?

It's hard to say exactly how many Islamic State fighters are in Afghanistan right now, but it seems their numbers have grown. Last March, the U.S. military estimated that about 700 ISIS fighters were in Afghanistan. By November, the top NATO commander in Afghanistan said that U.S. forces had killed more than 1,600 fighters on the battlefield. “It’s like a balloon,” he said. “We squeeze them in this area, and they’ll try to move out elsewhere.”

Michael Kugelman, a deputy director of the Asia Program at the Wilson Center, has called the group’s resilience “quite worrying.” Its fighters' strength, he said, lies in their ability to navigate Afghanistan’s challenging terrain with ease, which allows them to evade strikes. The group is also aided by “a steady supply of recruits” from disaffected members of the Pakistani Taliban as well as radicalized Afghans.

The group operates mostly in the Nangahar province, near the border of Pakistan.

What is the Islamic State’s relationship to groups such as the Taliban?

Tense. For one thing, the groups have different ideologies and goals. As Akhilesh Pillalamarri put it in the Diplomat, “the hostility that ISIS bears toward the Taliban stems from the fact that the Taliban draws its legitimacy not from a universal Islamic creed, but from a narrow ethnic and nationalistic base. In other words, while ISIS fights to establish a Caliphate encompassing the entire ummah (Muslim community), the Taliban merely seeks to establish an Afghan state that they claim is ruled by Islamic Law.”

 The groups are also in competition for members and resources. Both rely, to some extent, on money from the heroin trade to fund their operations. As Frontline put it, “the fiercest fighting has not been between ISIS and the government security forces, but between ISIS and the Taliban.”

That has created a deadly feedback loop that may at least partially explain the recent spate of attacks around Kabul. As Emily Winterbotham, a senior research fellow at the Royal United Services Institute, explained to Vice, when one group pulls off a particularly spectacular attack, the others might feel as if they need to one-up the competition.

“In terms of the Taliban, this could be a strategic attempt to demonstrate their continued strength in Afghanistan through high-profile attacks, whether in order to test the strength of the Afghan government, or in an attempt to ‘outbid' their competitors, most notably (ISIS)," she said.

Will the newest U.S. surge in Afghanistan have any impact on the Islamic State? 

Probably not.

As Winterbotham pointed out, violence in Afghanistan has continued to increase even as the United States has sent in more troops. In fact, violent groups have cited the increased presence of Americans as one of the motivations for their attacks. “It is worth noting that violence in Afghanistan actually increased hand-in-hand with increased foreign troop presence, even at the height of the surge,” she told Vice. “Military action failed to beat the Taliban then; there is no reason to think that it will work now.”

Haroun Mir, a political analyst in Kabul, also predicts that President Trump's surge will lead to a jump in insurgent violence by the Taliban and the Islamic State. That's what happened when President Barack Obama carried out a much larger surge in 2009. “Instead of confronting NATO forces on the battlefield they opted for these low-cost terrorist attacks,” he said, “and they have been very effective.”