Lets just give them a rational explanation though the game devs probably didn't feel it necessary to program a random backstory or name generator. Skyrim is in a dangerously chaotic state of affairs..at this time what with the war,inquisition,return of dragons,portents of daedric influence, and various other dissastrous omens and so many of its more vulnerable denizens have all but lost their minds.
The overall answer is they are npcs who have declined to give their names, and are not well known enough in the area of encounter nor to anyone associated with the PC for it to just be a given (some npcs are named despite being already dead when you find them). So the game presumes for the player to identify them based only on their most obvious profiling characteristic. UNfortunately this tends ot be racist if they are not obviously hunters,warriors in uniform of a faction, or magical practitioners.
We'll say the ones that attack are relatives or friends of someone you've killed in due course of battle AND: are either to too vengeful, honor bound,impoverised, or mistaken in belief that they are fit enough to challenge you themseleves*they don't know about autosave feature) and prefer to save their septims instead of hiring thugs or assasins. The authorities have deemed you acted in good faith of the law but these npcs were not satisfied and thus are willing to break the law, but they are not associated with any bandit troupe. We could also say some of them may just be already in a nearly aggressive state when they encounter you because they have just escaped a hostile situation and fear you may be a pursuer from that encounter. (I imagine this could actually be the real explanation though I doubt it.)