After scanning through the forums and the wiki, there seems to be 5 ways the AI deals with excess numbers of ships at their planets.
1. Build a barracks and put the excess ships in them
2. Free them according to border aggression
3. Start a cross planet attack
4. Start a scrap wave
5. Simply scrap them
My question is how does the AI choose which strategy to use, and where can I find information describing in detail how each of these mechanics work?