As Fret mentioned and I would add that the AI can control any other units, especially using V1.2. At the pre-battle match-up screen, you can select which additional armies the AI controls with the default being player control. So you can have more than 20 friendly units on the battlefield but only 20 can be player controlled.

The AI opponent can have many units on the map. I have had approximately 60 enemy units on the map at once in a big siege battle (I was defending). I have also had six small AI armies fight me in a open field battle with something around 35 units vs my 9 with enemy attacking from all directions. I bare won by fighting them piecemeal. Imagine a tight circle of Greek phalanx-type infantry with one merc peltast and one general in the middle. For awhile, it felt like Custer's last stand with waves of Macedon horse hitting then peltasts and militia hoplites. My poor general was the only man standing in his unit about 75% through the battle. Excellent fight overall.