The order of kana came from Devanagari, which is a phonetic alphabet used for Indian languages such as Sanskrit and Hindi.
Devanagari’s vowel order is: a, â, i, î, u, û, r, e, ê, o, ô. Its consonant order is from the back of the tongue to the lips:
velars (k, g, ng)
palatals (ch, j, ny)
retroflexes (.t, .d, .n)
alveolars (t, d, n)
bilabials (p, b, m)
semivowels (y, r, w)
and fricatives (sh, s, h).
Japanese doesn’t have retroflexes, and the consonant of the syllables now represented by “h” + vowels was “p”.
In addition, some linguists think the consonant of the syllables now represented by “s” + vowels was “ch”. (Other linguists think it was either “ts” or “sh”.)
Devanagari’s consonant order thus gives the Japanese consonant order: k, ch (later s), t, n, p (later h), m, y, r, and w.
Ja, mata ne.