Before he killed 26 people at the First Baptist Church of Sutherland Springs, Devin Kelley had an established history of domestic violence. Kelley was court-martialed in 2012 for assaulting his wife and stepson and sentenced to a year in military prison. He also sent his mother-in-law, who attended the church in Sutherland Springs, threatening text messages, which officials suggest may be related to the shooting. His mother-in-law was not at the church on Sunday, but Kelley’s grandmother-in-law was one of the victims.

“One thing everybody wants to know is, ‘Why did this happen?’ It’s a senseless crime,” Freeman Martin of the Texas Department of Public Safety said. “But we can tell you it was a domestic situation going on within this family.”

Kelley’s history once again points to the connection between domestic violence and mass shootings. An analysis of mass shootings from January 2009 to December 2016 by Everytown for Gun Safety, a nonprofit dedicated to reducing gun violence, found that the 54 percent of mass shootings are related to domestic violence, with perpetrators shooting an intimate partner or family member. Everytown’s analysis—which defined mass shootings as incidents with four or more victims, not including the perpetrators—found that from 2009 to 2016, mass shootings connected to domestic violence resulted in 422 deaths, of which 181 were children.

Marta Pelaez, the president and CEO of Family Violence Prevention Services, Inc., a shelter for women and children in San Antonio, calls murder “the ultimate act of control” for domestic abusers. “Domestic violence is a pattern, and that is a key word,” says Pelaez. “It is a pattern of behavior in a relationship when one of the members of that relationship is aiming to control the victim through psychological, physical, financial, sexual, emotional way.” According to Pelaez, that pattern can lead to murder.

“What can be more controlling than killing someone?” Pelaez asks.

Even when the victims in a mass killing don’t include the domestic partner or family members of the perpetrator, many mass murderers have demonstrated a history of domestic violence. As Rebecca Traister points out at The Cut, Mohamed Lahouaiej Bouhlel, who drove a truck through a crowd in France, and Omar Mateen, who shot and killed dozens at Pulse nightclub in Florida, both had a history of domestic violence.

“The anecdotal evidence suggests that there is a link to the extent that people who commit mass shootings are acting out through an expression of extreme violence, some kind of rage, some kind of grudge, some kind of anger,” Robert Spitzer, a political science professor at State University of New York in Cortland, told NPR. “And that is also consistent with behavior of those—and again, they’re overwhelmingly men, we should point out—who are also disposed towards domestic violence.” He notes that while many perpetrators of mass shootings have a history of domestic violence, domestic abuse does not always lead to larger incidents. “It’s important to point out that people who commit domestic violence, you know, bad though that is, for the most part do not commit mass acts of violence,” adds Spitzer.

There are legislative measures to prevent domestic abusers from acquiring firearms, like the Lautenberg Amendment, passed in 1996. The federal law prevents them from purchasing a gun, but would also allow law enforcement to remove firearms from someone deemed dangerous. Peleaz says that protective orders, which state that perpetrators can’t be within certain physical proximity of victims and prevents them from possessing a firearm, are also part of what she describes as a “very robust body” of law that addresses domestic violence. But, as in Kelley’s case, those measures can fail.

After Kelley was sentenced to one year in military prison for assaulting his wife and stepson, a routine background check should have prevented him from purchasing a gun. But because the Air Force “mishandled” his conviction and failed to file his criminal records in a federal database, he passed the background check. Kelley purchased four guns since 2014, including a Ruger AR-566 rifle at an Academy Sports & Outdoors in San Antonio, which he used in the mass killing on Sunday. NPR reports that the sporting goods store ran a background check on Kelley twice. He passed both of them.

When government agencies fail to properly enforce laws designed to protect domestic abuse victims, Pelaez says that calls for honesty, transparency, and difficult conversations about gun access. “When you have two systems that are not working in tandem to prevent someone from buying a weapon, it is disturbing,” Pelaez says. She worries that the Air Force’s oversight may lead victims, including domestic violence victims at Family Violence Prevention Services, to feel a lack of confidence in the military’s effectiveness at handling their cases. If the Air Force failed to properly report Kelley’s conviction, there could be other cases that haven’t been properly documented.

Ultimately, Pelaez believes there needs to be a deeper understanding of domestic violence and gun violence in general, not just in relation to mass shootings. “In 2016, 68 percent of perpetrators [in domestic violence murders] used a firearm to murder their female partners,” she said. Last year, 146 women were killed in Texas by their male partner and one in every three Texas women experience domestic violence at some point in their lifetime. For Pelaez, actual change means addressing societal patterns that contribute to domestic abuse, like generational violence and a culture of silence around abuse. Those difficult conversations go hand-in-hand with talking frankly about gun access.

“Is it because [guns] are so readily available? Do we need to rewrite laws, what do we need to do?” Pelaez asks. “People are afraid to talk about these things because very quickly it becomes politicized,” she adds, citing President Trump’s assertions that the Sutherland Springs shooting wasn’t a “guns situation.”

The conclusion of Everytown’s study on mass shootings calls for policies that could address gaps allowing guns to get in the hands of dangerous individuals, noting legal loopholes like purchasing guns from unlicensed sellers. Spritzer, speaking with Vox, said that there are challenges that make having conversations about tougher gun laws difficult, but that even more thorough gun permit applications can help to prevent mass shootings.

“Contrary to what many people say, the law does make a difference,” political science professor Robert Spitzer said. “It is the job of the law to make it tough or impossible for a person who shouldn’t have a gun to get a gun. But most states don’t do that. There are usually signals of mental health, of rising rage, uncontrollable rage and other things, but in most places, nobody makes that connection. In most states, they’re not asking questions of friends, neighbors, co-workers about whether the person should be a gun owner. And so are there signs? There absolutely are. And could they stop mass shootings? I don’t think there’s any doubt that they could—at least some of them.”