It has two main behaviors, traveling or eating. Looks like you have only seen traveling. Every time it hits a destination it stops to eat for 10 minutes or until the planet is cleared of stuff it can eat. The ai does not run away because that would then create a constant stream of a few thousand ships coming at you in games with devourers in them (ships that run away will attack you). The devourer, in a meta-game sense, is simply about randomly clearing out swaths of planets, thus creating both problems and opportunities from you. From a story sense, the individual ai ships do not know to run until it is too late. Incidentally, it is possible (if very unlikely) for them to kill the devourer.