You can retreat without being shattered. While bad at it, even the AI does it sometimes.
There seems to be different levels of 'orderly retreat'. Sometimes they go right where you tell them... other times they go 'near' that area... and some other times they go where ever the feel like.
I haven't figured out where those thresholds are, or even if this is a 'thing'.
One thing I really want to understand, though, is why sometimes they don't shatter at all... when nothing is blocking their escape. Recently I had a epic war against the Ottomans, me & my allies were sieging Edrine & their new capital Constantinople (and also Selanik to the west). Ottomans came across the straight and attacked Edrine with everything they had. I sent everything but 100 men from Constantinople, and 100 men from the Selanik siege... into the battle. I had allies attached, and was feeling confident -- but I knew it was going to be close.
We lost. And we DIDN'T shatter. Part of my army retreated NE, just to the province N. of Constantinople, and the rest retreated directly north. Ottomans hot on our heels. I had about 4 to 7 days before my entire army (which was considerable) was going to get wiped. -All of it (but 200 men). Fortunately I had the war goal, and enough war score to get an acceptable peace settlement. So of course, I did that... immediately. Silly A.I. You could've killed me.
But WHY did they not shatter back home? If they had, I might have regrouped and come up w/ a new plan.