The nature of how it works is described in the user manual, and yes it’s basically what @GoalieDad put:
Select the notes you wish to arrange into a stack. The first note you select
will not move, and subsequent notes will be placed under the first note in
order of distance from the first selected note.
Searching the forum for stack ordering probably also would have lead you to places like this post, where that was discussed. You might then have also noticed how that conversation involved finding a case where the software wasn’t really following the intended rules (a bug), and how it required very specific sample data to trigger it.
Hence…