The system is complex, to say the least. I've never had to delve into its inner workings so I'm not entirely sure. But!
Crimes raise local angriness. Angriness leads to more guards and people being more attentive(?). Angriness, I think(!), lowers over time. By itself, agriness only makes it harder for you to cause more crime undetected.
Crime must be detected to be reported to a guard.
If the player is detected and recognized(!) causing the crime or detected and recognized(!) in proximity shortly after the crime happened, the player is linked to that crime => you are a known culprit and, if the crime gets reported, the crime icon appears when you are in the affected crime area (called crime district - basically each town has its own constituent crime area).
When a person detects a crime they decide, based on severity and their RPG stats, whether to flee to guards to report it or to take the justice into their own hands (if they have the culprit). Note: A culprit may remain unrecognized! In that case people know who to chase but still don't know who it is.
As the people flee and shout, they emit the information and it could spread to other NPCs.
Reported crime is a crime which reaches a guard's ear, but only guards alerted by the shouting will join the chasing.
When you are approached by a guard, you have a limited time for surrender which forces the apprehension dialog. After that timeout fighting is the only option.
The apprehension dialog should handle all your unresolved crimes caused in the crime district. You can choose to refuse which leads to fight. All the other option bear the same result - charges are dropped. But only jail resets reputation (I think).
Anyway, you can reset the reputation by paying indulgences in churches or by serving your jail time.
I rob the entire Rattay blind
That by itself only raises angriness. You may have been caught steal some relatively cheap shit -> little reputation hit.
get caught by a guard, kill him
It might have been the only NPC around and nobody detected this murder and ascribed it to you
get caught in the streets, pass the speech check and my rep is intact
This only clears you off the charges. That still might have been some petty crime.
No idea what happened in Ledetchko. But the faction reputation is an average of personal reputations from all faction members. Which means pissing off one member of a small group might result bigger aggregate reputation drop than in Rattay with 100+ people. Also the reputation hits slightly propagate throughout the map. Which means pissing everyone around and hoping for godly status in the center is a pipe dream.