Yeah I remember a discussion over AI aggression in Empire total war. It was pretty much straight up a case of the more territories you gain, the more gold you have, the more likely it is that random AI will just declare war on you because the diplomacy is all about numbers and literally works on a +/- system. So if you get enough - points with various factions they will declare war on you regardless. And expansion is one of the main causes of that even if you are no where near the AI who declared war or have been allied with them for half the game.