There is no great source on the details across the nation, but there are a hodgepodge of municipal-level studies that shed a light.
There were roughly 20k gun homicides in the US in 2021[0]. It's been fluctuating between 10k and 20k over the past five decades or so, with the last few years seeing a quick increase and seeing a (hopefully) local peak in rates.
In one study in San Francisco, ~70% of gun homicide victims had a criminal record, and three quarters of that figure knew the suspect[1]. A similar study in Milwaukee found that ~90% of both victims and suspects of gun homicides had a criminal record[2], and the top two reasons identified of the circumstances behind the homicide were arguments/fights and robberies. There are other studies done at local levels in many other places with similar results.
A DOJ study notes that three quarters of all gun homicides were during the commission of a (different) felony[3]. And you can query the CDC WONDER mortality database[4] yourself to see that gun homicide rates in "large central metro" areas are twice as high as those in medium, small, or non-metro areas, and that men 15-34 years of age comprise the majority of gun homicide victims.
So, perhaps my "gang-on-gang" statement wasn't really accurate (since a "gang-related" incident is loosely defined), and I'll leave the "vast majority" determination to you; but the point is that most gun homicides occur among the "criminal element" in "bad parts of town", and is not really relevant to life as a software engineer.
Exactly, the reason "active shooter" situations frighten ordinary folks is because they're the rare type of shooting that can victimize you even if you're law-abiding and don't live in a very high crime area.
If we go look at other categories of shootings for 2022 we see that more than 20k people died from non-suicide gunshots.
And there were 647 mass shootings.
https://www.gunviolencearchive.org/past-tolls