When I play I make some strategies for what I want to achieve.
Examples from my current game, starting as the Dhayut using Super AI mod on chaotic settings.
Rule 1: I am not fond of nations popping colonies in my mining systems, and afterwards being annoyed at me having mining bases in their systems. I don't mine in conflicted systems, they make my systems conflicted.
Rule 2: I don't worry about foreign bases in systems I colonize/conquer. Of course, when conquering I nuke all enemy mining bases, but there may be bases there from other empires.
Rule 3: I stole the korabbian spice source from the humans in "their" cluster (colonized). It was weakly defended, war with the humans was not in my interest. Trade them spice, and see relations go up...
Rule 4: I started next to the Sluken, in the same cluster. I don't particularly want them as my enemies. Trade spice and smile, give away bases if they threaten with war. Of course, don't give the base, go to "different deal" and get some bases in return...
Rule 5: I want friendly relations with the rest of the scourge of the galaxy. Trade spice to Gizzies, Mortalen, Boskara... See them become friendly.
Rule 6: I don't like "non friendlies" colonizing "my" home cluster. This made me ultimate myself to war with the Ackies (they had 5-6 systems in my home cluster, including the massive minings operation system next to my homeworld). Afterwards they had nothing anywhere close to my home cluster (and became friendly, strange stuff).
Rule 7: Unless they are on my friend list, I take wars from threats. I will conquer 2-4 systems, and blast some extra space ports. Priority is to clean the borders (outlying colonies in my general direction). And the system with the base they nag about...
If each AI made some strategic decisions about friends and foes, the game would be more interesting. Clearly, if you wanted to befriend the Kiadians, and you can't because they for some reason decided to hate you, shift a strategy, and befriend one of their enemies instead.
Today I think they only rule by reaction on general dislike, and what happens to begrudge them due to accidental conflicted bases.
Btw, with some sensible "borders" system in the game, friendly nations could agree on borders...