You get bandits and you get aggressive npcs. If you look at your map the aggressive npcs should be red
Quickest way to test is shift + c to talk to them from a distance.
Bandits will not want to talk and distrusting/ mugging NPCs will at least try and open some form of dialogue.
Bandits you consider them like ferals with guns and weapons that haven't gone feral
The ones that try to talk you can talk them down if you are "charming" or "intimidating" enough. Or you comply with their demands up to you to roll the dice