The AI engine in this game is one of the simpler ones I have developed and I'm still tinkering with it. It is based on a number of earlier games I wrote in javascript and these are freely available on my web site. The first was Ancient Empires, followed by Roman Empire(JS) and lastly Byzantium which is probably the best example. Just popped over to the site and looked at the JS code - it is rather cryptic.
The overall theory is that each nation has a set of home provinces it must try and retain. It then has a 2nd set of nice to conquer. During alternate turns(to speed things up) a check is make for each nation of these provinces and if one is held by an enemy the target and path is given to the army and then an effort is made to take it back (in order of importance). There is a movement routine that takes care of moving armies to and fro. In earlier games the units found their own paths to the target. In The Roman Empire because it only has some 30 provinces I opted to go with a path table (and a road to Rome table for rebel armies) which allows armies to take realistic journeys from one prov to another and to retrace that path home again. There are thresholds for nations and armies which prevent them from fighting all the time. They do need to rest and recuperate. Also there is a time table which alters a nation's provinces, leaders, goals, etc. so that they will not keep behaving in the same old way but will follow historical events. Just as important is the economics and recruiting that slowly builds the state / military. These are based on historical data as much as possible. Random numbers are used in a very controlled manner to affect aspects of the economy, Romanization and loyalty so that each game can be slightly different from the preceding.
If you haven't fallen asleep yet and the JS stuff has left you perplexed I can send you the AI routines but the JS is better (has diplomacy, trade, spys)