One of the problems is that the AI onlynseems to look at absolute strength, not relative.
This right here is very key.
The AI looks at absolute strength, and does so by only looking at the military score which is derived directly from the sum of the individual unit's combat strengths.
This has some very odd consequences, which can be abused by the player.
Last year for instance I had Rome declare war on me.
He had an army value of 1000, while my "small" army was about 300-400 in army value score.
However, my army consisted of Cavalry corps/armies, Bombards/Artillery and Battleships.
His army?
A ragtag Classical Era mashup of Legions, Spearmen and Catapults, all sailing mindlessly on the open seas.
Due to how the game calculates the army score however, the Rome AI didn't grasp that relative difference.
It looks at a Single Legion as being worth 40 army value as it just copies the raw base combat strength, and given enough of them, it added up to a total of 1000 army score.
My Cavalry corps on the other hand, while few in numbers (prolly only had 3 or so running around wreaking havoc) had an army value of 72 each (the individual combat strength).
When it comes to a 72 combat strength unit however, such a unit can single handedly take on and defeat at least 3-4x 40 combat strength units by itself before it should heal for a turn or two.
The AI doesn't recognize this however, and thinks it has the upper hand and therefore DOWs you, before getting promptly killed by a vastly superior force.
The reverse is also true.
While your "super far ahead technologically"-neighbour might have fielded a handful of Tanks or even GDRs, they will often not recognize their immense military advantage and stay peaceful and friendly.
In my last game, Scythia had several Coursers, but mostly stayed friendly (apart from when she got a
lot of them, for a high army value score) because she saw my "military power" as not worth messing with.
My army at that point was a mishmash of one Warrior, one Heavy Chariot, one scouting Bireme, one Catapult, one Horseman and some of Archers from the Ancient/Classical Era, where I hadn't bothered upgrading a single one of those.
Still, the game showed my army value of being at about 250 or so, which was a joke compared to Scythia's 380 army value consisting of (far superior) Coursers.