I don’t think it is random.
All Tiles stay consecutive except the one you are moving. When you hold it over the space (line) between two Tiles (or at the left or right edge of the screen beside a Tile) all the other tiles closest to the now empty space will slide away in the always deterministic direction to fill that space you vacated by dragging the tile out of it (ie, slide forward if you’ve moved a tile to earlier in the set hence preparing a slot forward of the new position, or slide backwards if you’ve moved a tile to a later spot in the set).
The screen does not scroll during dragging a Tile (on my phone…) so you may have to drop it somewhere partway to the destination, then scroll, then drag it again.
Suppose a video would help.
If you understand the above described behavior, then there should be an optimal order to pick tiles to sequence them… I’d say… Get the first or last tile in place then drop each one in order desired…