So many other countries in the area were taken over by the English or French (or, in the case of Indonesia, the Dutch and the Portuguese). Why did Thailand withstand, when neighbors like Cambodia, Vietnam, Burma and so on?
This is outside my area of expertise, but I cover it extensively in my Modern East Asia history class as a complementary example to the experiences of Japan and China with Western imperialism.
In addition to serving as a buffer state between French Vietnam and British Burma, Thailand's 19th and 20th century rulers were adept at using Western international and diplomatic discourse to present themselves as modern, Western-style monarchs on the world stage. They ensured treaties with neighboring kingdoms and Western powers used Western diplomatic language, and relied extensively on formalized documents to back up claims to self-sovereignty. At the same time, Thailand managed to somewhat modernize its institutions, bureaucracies, and military, imposing centralized state control over a previously loosely ruled series of autonomous regions, and "homogenizing" Thai culture to foster the development of a Western-style nation-state.
While, as other posters have noted, Thailand did lose land to France and Britain, their efforts at using Western methods of diplomacy and the language of sovereignty largely succeeded. It made it difficult for Europeans to use "civilizing" rhetoric against a kingdom that, at least on the surface, was successfully "civilizing" itself and modernizing.