They will break out and patrol to (and thus attack) a planet if the number of freed ships on that planet hits or exceeds 100 or so, if that planet is adjacent to a planet they are already patrolling to.
However, if you are keeping your threat in check and neutering properly to prevent border aggression from being noticeable, then this trigger won't really happen all that often. However, watch what they do once a cross planet attack or an exo-wormhole attack (or whatever they are called) get near your planets. You should see them wandering out in those cases, as there are most likely FAR more than 100 ships that are freed or spawned as freed in those types of attacks.