Now I've been paying more attention to that. It seems to me that the AI protects relatively well its troops when accumulating them (in some system close to its target) and when sending the troops to the destination. Each time I kill an undefended stack of troops, this stack seems to belong to a failed invasion mission. So far I've identified
1. The military force of the invasion mission got to destination and was killed.
2. The military force of the invasion mission retreats when the defending forces have grown stronger and counter-attack before the invasion has been attempted.
3. The military force of the invasion mission seems to be called upon something happening elsewhere.
In the three scenarios, the accompanying troop ships are left where they were, apparently forgotten, and will stay put even if they see incoming enemy forces with ETA>1.