In the wake of the massacre at a small-town Texas church on Sunday, many people are asking why.

A large portion of the mass shootings in the U.S. in recent years have roots in domestic violence against partners and family members. Depending on how you count, it could be upwards of 50 percent.

We know the Texas gunman, Devin Patrick Kelley, was court-martialed for assaulting his wife and their young child in 2012, although this information apparently was not included in the formal government database that tracks such things.

There are laws on the books preventing convicted domestic violence offenders from obtaining weapons. So why does this keep happening?

There are no easy answers. NPR's Alison Kodjak recently talked with Daniel Webster, director of the Johns Hopkins Center for Gun Policy and Research in Baltimore, Md., about the complexities of gun violence, mass shootings, and the difficulty we have in understanding the people who commit these crimes.

While perpetrators of domestic violence account for only about 10 percent of all gun violence, they accounted for54 percent of mass shootings between 2009 and 2016, according to the advocacy group Everytown for Gun Safety, so there is a disproportionate link, Webster tells Kodjak.

"Generally, it fits a pattern of easy access to firearms of individuals who have very controlling kind of relationships with their intimate partners and are greatly threatened when their control is challenged," he says.

And yes, there are laws preventing convicted abusers from getting guns, but there is a "girlfriend loophole."

"In our current times, many young people put off marriage for many years," he says, and these domestic partners aren't protected by many existing laws that are largely aimed at spouses and children.

There are a few obvious signs that someone is considering mass murder.

"Individuals who are amassing a number of weapons and a large amount of ammo, that obviously is a red flag. Individuals whose violence generally extends beyond the family would be an indicator of greater danger," Webster says.

But even though mass shootings have become more common over time, it's hard to pull together a specific profile that fits every shooter.

The Las Vegas shooter, who killed 59 people last month, didn't have a record of domestic violence and didn't show obvious signs of mental illness, Webster adds.

"Look, this is imperfect science — this is social science — predicting a relatively rare phenomenon in large populations of people," he says.

SeparatorCopyright 2017 NPR. To see more, visit http://www.npr.org/.