Usually because the guards know that the dictator’s lieutenants will make sure that the offending guard died a very painful & prolonged death.
To send the message to future guards, “Don’t even think about assassinating ME when I’m the new dictator!”
IIRC, Indira Gandhi’s Sikh guards assassinated her for her giving the order to storm their Golden Temple.
What is our Sikh gaurd and where is their Golden Temple?