Thai borrowed some letters from loanwords of Sanskrit and Pali. Many of those letters sound or sounded differently in the languages they came from, but they now have the same pronunciation as other Thai sounds. Letters borrowed from Sanskrit and Pali are only used to write those same loanwords from those same languages.