Thai devloped from a loose collection of similar
writing systems in South
India labeled under the
Grantha type, which themselves developed from
Brahmi. The
orthodox explaination for the Thai script's development is that a Grantha writing system was adapted by King
Ramkhamhaeng in 1283
CE. His main contribution was the introduction of tonal markers, which were relatively unimportant to the
Indic and
Dravidic languages previously represented by Brahmi derivatives, but absolutely vital to Thai. As a (nominally)
Sino-Tibetan language, the five tones distinguishing
homophones had to be made clear. It is thought that Thai was the first writing system in common use to indicate
phonemic tone.
While the script began as a directly phonetic representation of Thai, sound changes have caused the script to become somewhat more complicated. Several qualities of Thai consonants, such as pre-aspiration and pre-glottalization have disappeared. Others, such as aspirated/unaspirated distinction and voiced/unvoiced distinction, became more limited. An example of this in English would be if the sounds represented by 'k' and hard 'g' merged to just 'k', yet both letters were still used. Concurrently, tonal distinctions became more pronounced. The result was that there soon grew to be an abundance of unneeded consonantal signs and not enough tonal signs. Thus, consonants representing the same sounds were divided into three groups, with each group corresponding to a certain class of tones. These groups are called kla:ng, sû:ng, and tàm (mid, high, and low, respectively).
With modern standardization, Thai has moved further away from phonemic correspondance with the spoken language. Like English (and this is the main reason why English spelling is so absurdly complicated), many Thai spellings contain etymological information that has nothing to do with the pronunciation of the word. Extra unpronounced characters are retained to indicate that a word originated from Sanskrit, much as the spelling of 'night' indicates that the word is of Germanic origin even though 'gh' is certainly not pronounced. The situation becomes especially complicated with final stop consonants. A native Thai word can only end in -p, -t, or -k for a stop, yet there are sixteen different individual letters for representing those three sounds, twenty-seven letters that can transform into one of those sounds in final position, and a proliferation of silent etymological letters.
Handwritten Thai sometimes makes use of small 'heads' which are written first similar to those present in other Brahmi writing systems like Devanagari, Kannada, and Oriya.
Daniels, Peter T., Bright, William. The World's Writing Systems. Oxford: Oxford University Press, 1996.