Why is it and can it be counted on?
Any hash is going to have a "natural sort".
A "natural sort" is either maintained either as each element is inserted or is performed before the first search.
If there is no natural sort returning a value matching a particular key would require an exhaustive search.
An exhaustive search, of course, would take n comparisons where n is the number of elements in the hash.(e.g 65536 elements searched in 65536 comparisons.)
On the other hand, If a hash is sorted alphabetically by KEY, then a binary search can find a match in LOG2(n) comparisons. (e.g 65536 elements searched in 16 comparisons.)
There are other sorting methods, but they all require some initial sort. This sort could be a system with a hidden index that leaves the key/value pair elements unsorted.
e.g. In the following partial implementation, the key/values pairs are stored as objects in an underlying array.
myArray[0] = {"b", "Skies"}
myArray[1] = {"c", "dog"}
myArray[2] = {"a", "Jax"}
myArray[3] = {"d", "gone"}
myArray[4] = {"r", "run"}
myArray[5] = {"q", "quit"}
a second array, to which the Ruby developer has no access, holds the sort.
sortArray[0] = 2
sortArray[1] = 0
sortArray[2] = 1
sortArray[3] = 3
sortArray[4] = 4
sortArray[5] = 5
Thus, internally to the hash object
for(i=0 to 5)
print myArray[sortArray[i]]
would print the sorted array.
Ruby's spec apparently does not specify which method to use, sorting by key, a hidden sort, or some other method, so, no, you can not count on the natural sort.