From what I've seen, the AI works like this after a war begins:
- If war is going well, never make peace.
- If war stalemates, offer peace.
- If war is going poorly, offer peace with concessions.
The war can stop only if both AI participants reach the middle condition. So you tend to observe two types of wars: those where an AI gets rolled, and those that end swiftly. Third players can change that calculus, of course. The AI doesn't want to fight multiple front wars any more than you do.
If that is true, then it really needs to get fixed. Never-ending war is just as bad as never-ending peace.
Say, if a war is going well, have a 25% chance on each turn to decide they've conquered enough and offer peace.