Why were Thailand and Japan never (successfully) invaded by foreign nations?

by Luxara-VI

Many parts of Asia were invaded by European powers, but not Thailand and Japan. Why?

Starwarsnerd222

Greetings! This is certainly an interesting question, and I shall be weighing in with some perspective on Japan, so hopefully another AH traveler with more expertise can weigh in with the relevant information for Thailand. It is worth noting that OP's remark of "(successfully)" invading Japan is an accurate remark, as there were certainly attempts (most notably by the Mongols) to invade the Japanese Home Islands. On another note, some parts of my response have been adapted from a previous response on this thread about why no European powers attempted to "colonise" more of Japan, and that question has great input from u/ParallelPain, whose flair is actually more relevant than mine to this answer (hint hint wink wink to Parallel if they're reading this). This response will focus more on the late 17th to mid 19th century considerations which prevented successful invasion of Japan, and why no countries seemed to find it worth their while. With those preambulatory points out of the way, let's begin.

The Isolation of the Islands

Japan during the Tokugawa Shogunate (r. 1603-1868) was a country with a fairly isolationist foreign policy. During these years, the policy of the Japanese to foreign traders can simply be summed up in one word: 'seclusion'. The shoguns of the Tokugawa era were particularly wary of efforts by European traders to "sell" their religions alongside their trade goods, fearing that such influence would lead to the rise of internal threats with support from the Europeans. Under the shogunate of Tokugawa Iemitsu (r. 1623 - 1651), the Spanish and Portugese traders were forced to leave Japan, barred from ever entering it again. In another edict, Iemitsu forbade all remaining foreigners (namely the Dutch) from travelling inland, as well as selling or giving books to any Japanese person. Thus by the 1640s, Europe's link to Japan had been all but severed. Only the Dutch remained to trade, but they were content to abide by the strict regulations imposed from Edo. All they had was a small trading outpost on the "landfill island" of Dejima, in Nagasaki harbour. Rather interestingly, the Dutch (mainly representatives and merchants of the Vereenigde Oostindische Compagnie, or United East Indies Company) were highly discouraged from even learning Japanese, in an effort to avoid them getting too "close" to the local populace whom they interacted with.

Interestingly enough, this isolation did not stop other European nations from trying to set up a colony-like holding somewhere on the Japanese islands. The British had attempted to mimic the Dutch, going so far as to set up a factory at Hirado in 1613, but this effort was abandoned just ten years later (in part due to the Dutch dominance of trade, and also due to the increasing reluctance of the English merchants to invest in the Far East trade). Thus from the 1640s up until the 1850s, Japan remained a closed country to the West; though not, and we must stress, not, an isolated country from the rest of Asia (but we digress from the main point there). Even as late as the late 1700s and early 1800s, the prevailing thought of bakufu (shogunate) officials and daimyo was that legitimate rule of a unified Japan meant the exclusion of Western nations from its affairs. Below is a revealing bit of writing from Tokugawa critic Aizawa Yasushi, which illustrates such a sentiment:

Recently the loathsome Western barbarians, unmindful of their base position as the lower extremities of the world, have been scurrying impudently across the Four Seas, trampling other nations underfoot. Now they are audacious enough to challenge our exalted position in the world. What manner of insolence is this?

This is a key consideration when we discuss the possibility of a foreign nation attempting to successfully invade Japan: its hostility towards any and all "invaders" (even if they were actually merchants looking to open a new market). The first half of the 19th century saw many developments between European nations and Asia, as Qing China was forcefully "opened" to the trade networks of Europe during the First Opium War (1839-1842) and would face further humiliation as a result of the "unequal treaties" which followed. Japan however, remained a nation with its doors firmly closed to the West, though the shogunate did loosen some of the restrictions (most notably the "fire first, say no to trade later" rule) to ward off foreign influence.

The second consideration we must take into account is rather simple: logistics. Japan's geographical isolation as an island chain in the Pacific Ocean meant that many of the European powers would struggle to support an invasion force attempting to take it by force. The Russians were slightly less inconvenienced by this geographical distance, with its Siberian borders being much closer to Japan, but these ports remained unable to sustain a large invasion force (let alone one which would have to constantly be resupplied and reinforced). There was also another problem with simply "blasting Japan open" to the Europeans: its government structure and warrior culture. Though the bakufu was certainly not as centralised per se to the equivalent governments in Europe, by this period of Japanese history the fractured clan-based civil wars and cout intrigue of the Sengoku Jidai era were no longer present. For any European power, maintaining a considerable "expeditionary force" if you will (not to mention the required naval assets for many) would be a wasteful and costly experience on the whole. Further, from the 1640s to the 1850s the many European powers were occupied elsewhere in Asia, the Americas, and even (though to a far lesser extent) Africa to place serious thought into "colonising" the Japanese mainland through an invasion.

Part 1 of 2 (terribly sorry for the seemingly short response parts, Reddit character limits for comments can be a tad annoying when you've got various headings for the writeup).