(CNN) Scott Atran and his research colleagues were sitting face-to-face with captured ISIS fighters in Kirkuk, a city in northern Iraq, near the front lines of battle.

The researchers handed the fighters a set of cards, engraved with study questions to answer.

"They literally threw the cards down and said they refused to respond," said Atran, a cognitive anthropologist who is director of research at Artis International , a multidisciplinary research institution , and who holds teaching positions at the University of Michigan and the University of Oxford.

To Atran's surprise, the fighters were still willing to answer research questions; it was just that those particular questions were incomprehensible to some of them because the questions focused on the wrong motivations, he said.

Atran and his colleagues spent the past couple of years interviewing captured ISIS fighters, as well as Kurdistan Workers Party (PKK) members and other front-line fighters battling against ISIS, to better understand what drives anyone to willingly attack and die for a cause.

The researchers discovered that three crucial factors motivate both ISIS fighters and those fighting them: a deep commitment to sacred values, the readiness to forsake family for those values, and the perceived spiritual strength of the group or community that the fighter represents.

The findings, which were published in the journal Nature Human Behaviour on Monday, also help explain why the ISIS fighters whom the researchers interviewed were irritated with the initial line of questioning, Atran said.

That first round of research questions was not related to sacred values. Yet when Atran and his colleagues developed new questions and measurements based around spirituality and values, the ISIS fighters started opening up, he said.

The study could "help to inform policy decisions for the common defense" and fighting terrorism, the researchers write.

"The main thing that really matters to them is what they 'feel in their hearts,' as they themselves put it. Some of these guys are really committed," Atran said, adding that he found the same characteristics in the Kurdish fighters and others fighting ISIS.

"In our material world, we have underestimated or underplayed the spiritual dimension of human action," he said. "Doing so runs the risk of leaving ourselves open to people who are motivated by deeper spiritual and sacred values and virtues, and I think that's the greatest danger we face."

'Not only are they willing to sacrifice their group but their family'

To examine what may drive someone's willingness to fight and die, the researchers analyzed their previous interviews with captured ISIS fighters and PKK members from 2015.

Then, in the new study, the researchers carried out a quantitative field study in which they interviewed 19 Peshmerga or Kurdish Regional Government forces, 17 Iraqi army Kurds and 20 Arab Sunni combatants -- all fighting ISIS -- about their willingness to make costly sacrifices for the sake of their values, from February to March 2016.

Many of those interviews were conducted on the front lines of war.

To get access to the front line, "we had to talk to the political leaders or whoever was in charge of the territory," Atran said.

He added that his colleagues and he would try to connect with the fighters through word of mouth or even with the help of journalists covering the war.

The sacrifices mentioned in their interviews were dying, letting their families suffer, killing civilians, undertaking a suicide attack or torturing women and children.

The researchers checked the combatants' responses to interview questions against objective factors, such as the frequency of being wounded in battle or time spent at the front line, Atran said.

JUST WATCHED Majority of ISIS victims are Muslim Replay More Videos ... MUST WATCH Majority of ISIS victims are Muslim 01:24

Next, the researchers conducted 14 separate online surveys and controlled psychological experiments in which 6,649 noncombatants in all regions of Spain, including the North African enclaves of Ceuta and Melilla, indicated their own willingness to make costly sacrifices.

Among all study participants, whether on the front lines or noncombatants, the researchers found that the willingness to fight and make sacrifices was associated with whether people saw themselves as having greater spiritual strength than their enemy rather than having greater physical strength.

The findings were based on all study participants' in-person interview responses to questionnaires that included experimental designs and measures or online survey results.

JUST WATCHED Former al Qaeda recruiter's warning about ISIS Replay More Videos ... MUST WATCH Former al Qaeda recruiter's warning about ISIS 04:10

"This means that sacred values and strength of spirit are critical driving factors for ISIS fighters and the people fighting against them most successfully," Atran said.

"Now, what if, when push comes to shove, the values and the group divorce? Are you going to go with your buddies or the values? We found for the most devoted fighters ... those most willing to make sacrifices were those willing to sacrifice their group" or buddies, he said. "Not only are they willing to sacrifice their group but their family."

Predicting an enemy's will to fight can be crucial in times of conflict, according to the study.

Atran pointed to how in 2014, President Barack Obama endorsed the declaration of former Director of National Intelligence James Clapper that "we underestimated ISIL and overestimated the fighting capability of the Iraqi army. ... It boils down to predicting the will to fight, which is imponderable."

Measuring 'what motivates us all' to die for a cause

Limitations of the new study include that the data are based on small numbers of participants from the battlefront due to restricted access, and data from noncombatants are self-reports that are only representative of Spain.

Moving forward, however, Atran said he and his colleagues are working on followup research that involves brain-imaging data.

All in all, for the researchers to combine ethnographic fieldwork with fighters, scientific theory and online surveys was "impressive," said Josh Horgan, distinguished professor at Georgia State University's Global Studies Institute and Department of Psychology.

"The challenges of doing such research shouldn't be underestimated, but this study shows us that it can be done," said Horgan, who was not involved in the study but wrote an accompanying editorial in the journal Nature Human Behaviour.

"What this study tells us is that there are three compelling reasons why someone would be willing to fight and die: They commit to and embrace some sacred value, they willingly forsake their own kin for those same values, and they truly believe in the spiritual strength of their own group compared to the enemy," he said. "This is an elegant theory that makes both intuitive sense but is supported by real-world data."

In other words, he said, "there are common psychological threads woven into the fabric of what motivates us all to fight and die for a cause."

In general, those are main components of research on radicalization and terrorism: the ideology component and to some extent the network component, or the component of having support from others who share your values, said Arie Kruglanski, distinguished professor of psychology at the University of Maryland and a fellow of the American Psychological Association.

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

"The ideology component addresses individuals' need to matter and feel significant. ... It tells people what to do, such as fight and make sacrifices, in order to gain respect and admiration from others," said Kruglanski, who was not involved in the new study.

"Especially when it comes to violence that is shunned by most religions and most cultures, you need validation from a group of people that would then become your reference group. So the group component is very important, particularly when it comes to antisocial activities that are forbidden or shunned," he said. "Some of Scott Atran's work addresses that aspect. In general, I think it's a very important piece of the puzzle that Scott and his colleagues are addressing."