This is called karma. Karma is not very nice to people you see, she tends to bite back to achieve balance.
You should meet Karma's cousion, Capitalism.
But on topic, this makes sense. You got in trouble, and now your paying for it. You either killed one or stole from another, and will pay for it. Why should the guards give a hoot if you brought this upon your self?
It is called cause and effect.
Considering you can have hired thugs sent after you without ever doing anything illegal, and it only ever happens once, this argument fails. There is a particular quest in Riverton that no matter how you do basically guarantees Hired Thugs will be sent after you. You can also have Hired Thugs sent after you by characters you have never interacted with before.
Once I was coming out of the first dungeon, never stole anything from anyone. On my way back to return the item I went to get some Hired Thugs came after me, sent by Moira.... I had never been outside Riverton, yet Moira was mad at me? Because I "wronged her"? (I didn't even know who Moira was because I'd never gone to that location yet, on any character.)
Also most other NPCs that attack you guards will attack, like Thalmor or imperials (which makes way less sense than attacking hired thugs).