What bothers me in all this is that the AI is not playing to win, it is playing to win against the human player.
Here's a scenario that best helps explain how I think the AI SHOULD work in terms of declaring wars:
A is strongest
B1 and B2 are second strongest
C is weakest
Let's ignore who is empire and who is kindgom, lets say all are kingdoms.
A decides to declare war on B1 to overtake its lands. Now, with the current AI B2 would probably declare war on B1 as it takes a hit on its power level from having to battle it out agains the stronger A. Especially if B1 is the human player.
BUT! If B2 really wants to win the game, it either needs to not wage war on anyone, OR wait for the armies of A and B1 get into action and then declare war on A, as it has its resources allocated to fighting B1. This is one of the few chances B2 has to overcome A and prevent it from steamrolling over it after it has destroyed B1.
This is how you win games against stronger opponents in Civs; you wait for them to declare war on someone and then declare war on them, hoping you can grab at least some of their ground and they're willing to call a truce as they can't fight on multiple fronts for too long.
What C should do is either declare on B1 to grab some spoils from the war with AvsB1 (B1 can't afford to focus on C if A is pounding on them), or just stay out of it.
That's how you play to win. B2 would gain next to nothing for waging war against B1, as they would lose troops against them and A could easily attack them immediately after he's done with B1.
I want the AI to play to win the whole game. If they're not the strongest player, they have to constantly look for chances at attacking the strongest one. If the human player is weak, then unless you can easily nab their lands and gain useful resources from it, it doesn't make any sense to wage war against him unless you are the strongest player and want to start destroying everyone one by one.