Last year, at a global conference on sexual violence during war, many speakers agreed that the best way to deter such crimes was prosecution, and they called for more of it. But prosecutions are not enough. We must work to reduce sexual violence by armed groups during wars — not just act afterward.

First, we have to better understand it. Although rape during war is an ancient crime, it’s only in the last decade that social scientists have begun to study the patterns in which soldiers and rebels rape. The findings may be surprising: It’s not more likely to occur in particular regions, countries with greater gender inequality or during ethnic conflict; men may be victims, and women can be perpetrators.

But while rape is tragically common in war zones, it’s not an inevitable part of war. In fact, we have found that a significant percentage of both armies and rebel groups in recent civil wars were, surprisingly, not reported to have raped civilians. That’s because commanders have options: They can choose to order, tolerate or prohibit rape. A deeper understanding of their behavior offers the hope of mitigating the problem.

Some commanders order rape as a military or political strategy, and specify the target. As the Soviet Army marched toward Germany in 1945, generals ordered soldiers to take revenge on all Germans, not just soldiers. Guatemalan soldiers systematically raped indigenous Mayans during the civil war from 1960 to 1996. Today, the Islamic State forces Yazidi women and girls into marriages and sexual slavery, which they wrongly believe is legitimate under Islamic law.