Kingdoms reinforcement AI is better. The OP sounds very much like Medieval2 vanilla.
Anyhow, the AI does a unit versus unit check when deciding who and where to attack. It is predictable and can be manipulated to create a scenario that you want. You have to be familiar with the units and counter-units that the AI works with. Generally you'd want to pay attention to what units you are pitting against one another. Normally the AI will not engage units that it knows it has no chance of winning against (there are exceptional cases).
In terms of overall strategy, the computer has none other than the artificial rules they have to work with. The computer emphasize on formations almost exclusively with little regard to the overall tactical situation. This can be a pain but you can work around it by omitting certain units that's messing with your realism. Simplest recommendation would be to start with only one core unit type and adding one more as you work out how the computer react to the changes.
A fail scenario example would be in getting an AI controlled town militia army supported by cavalry to attack a line of dismounted knights. The AI in this case will favour cavalry raids and leave the line battle till absolute last if at all (top picture). In the test battle I fired up, the AI's center battle line never even engaged and it opted to use the melee units to bulk up the flanks instead, leaving itself open through the center which is remarkably unrealistic... But by tweaking the unit composition a little, you can coax the AI into fighting in a certain way. Trying to get the computer to fight a line battle for eg. you'd need a more balanced unit vs unit scenario (bottom pic). Here the AI is more receptive to getting dirty in a long line because of a fairer match up plus the absence of power units that might've given it other ideas.
As for skirmishing units, well there's no hope in that. Skirmish mode is broken and I cannot remember which Battle AI mod that made it to work semi-decent. Could be XBAI can't remember.