The word "arigato" (有難う), or "thank you" in Japanese, finds its roots in the word arigatashi (有り難し), an archaic adjective describing rarity.
Arigatashi was used in the Japanese language at least as early as 1000 years ago, as it is documented in both the Tale of Genji and Sei Shonagon's pillow book. Originally, the adjective indicated that an object was difficult to have or come by, or literally, "difficult to exist." This meaning was extended in use to express that something was valued, as it was not easily found.
At least one Japanese translation of the Lotus Sutra, upon which Nichiren founded his school of Japanese Buddhism in the 1200s, used arigatashi to express profound feeling over the mercy and magnanimity of the bodhisattvas. Over the next few hundred years, the linking form of the verb in old Japanese (arigatashi → arigataku) underwent a change in pronunciation and orthography, to arigatau (く→う、有り難う), then once again to the modern form of arigato.
The commonly noted similarity between Japanese arigato and Portugese obrigado ("obliged") would therefore seem to be pure happenstance, considering that arigato had been in use long before Portugal's (or the West's) first contact with Japan in 1543.
By the early modern era, arigato had slipped from primarily Buddhist circles into mainstream language as an expression of thanks, though even in modern Japanese the adjectival remnant can be observed in somewhat more formal expressions such as arigatai desu (有難いです) and arigataku zonjimasu (有難く存じます).
Kiryu Buddhist Federation