It is fully unsorted and simply in the order of the mesh being added to the scene.
This would change the order as well https://playground.babylonjs.com/#4FW2TU#1 (moving the ground creation before the sphere)
This is mostly for perf as it is not always needed to be sorted. You could sort the result on your side by the distance.