America has endured school shootings, workplace shootings and church shootings; shootings by racists, extremists and the mentally ill; shootings with pistols, shotguns and military-style rifles. Sunday’s deadly shooting at the Gilroy Garlic Festival offered more terrible proof that setting, manner and motive are largely a distraction. The problem is the shooting.

Shattering the signature celebration of the farm town on the Bay Area’s southern edge, the shooting left two children and a young man dead, wounded 12, and reaffirmed that no apparently peaceful corner of American life is safe from gun violence. In fact, Gilroy wasn’t the only place to see its time-honored, family-oriented festival disrupted last weekend: A Saturday shooting at an annual gathering in Brooklyn, N.Y., killed one man and injured 11.

Contrary to the unfounded claims of gun-rights absolutists, the shooting also underscored the incapacity of all manner of security measures and so-called good guys with guns — the firearms lobby’s mythic response to every bad guy it empowers — to prevent such senseless bloodshed. Festival officials took the precaution of metal detectors and searches upon entry, but the gunman reportedly crossed a creek and breached a fence to elude security. Gilroy police said they responded in less than a minute and fatally wounded the attacker, but not before he killed a man in his 20s, a 13-year-old girl and a 6-year-old boy.

“Any time a life is lost, it’s a tragedy,” the town’s police chief, Scot Smithee, said Monday, his voice catching. “But when it’s young people, it’s even worse.”

Even under a restrictive definition of mass shootings requiring at least three deaths, it’s been only two months since the country’s previous one, according to Mother Jones, at a municipal building in Virginia; nine months since California’s most recent such attack, at a Los Angeles area nightclub; and not quite a year and a half since the Bay Area’s, at a Napa Valley veterans’ home.

While such massacres have become all too common, they represent a minuscule share of the gun toll. In 2017, for example, even under the expansive definition of mass shootings used by the Gun Violence Archive, the 29 killed in California mass shootings made up less than 1% of the more than 3,000 people felled by guns in the state.

Sadly, that’s not many by American standards. California has the eighth-lowest gun deaths per capita among the states, about a third less than the national rate. But that’s more than twice the worldwide average and even more out of proportion with rates of other wealthy countries.

California has among the strictest gun laws in a firearm-friendly country, and its rate of gun violence reflects that. Readier access to guns generally correlates with more firearm-related fatalities across states and countries. It follows that California is relatively safe for a U.S. state but dangerous on a global scale.

The Gilroy shooting seems to have demonstrated the limits of even the most restrictive state-level gun laws. The AK-47-style rifle the 19-year-old shooter used appears to have been illegal under California’s assault weapons ban, The Chronicle reported, while a law that took effect in January prohibits most gun sales to those under 21. But the perpetrator reportedly bought the rifle legally in Nevada this month.

We will undoubtedly learn more about the weapon, the details of the police response and the motive of the killer, who apparently alluded to racist ideology on a social media account, but we already know how to make such violence less likely.

That we haven’t is a national failure with horrific and unending consequences.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.