Was it just that India was split up in many small states, where as Thailand or China were empires with huge armies, so that they could defend themselves?
There's a problem with the premise of this question.
For one I'm not sure you can say that they actually did escape it. Korea and Taiwan were both colonised by Japan for a significant period of time. China lost multiple chunks of territory to multiple parties, including most of the Northeast (Manchuria) to Japan and the Soviets, Hong Kong to the British, parts of Shandong to the Germans, Macao to the Portuguese.
Nor is it accurate to say China was an empire with a huge army. Internal and external conflict as well as famine and a weakening government left China largely unable to fight off an invasion, and it was precisely this kind of issue that further encouraged Japan to move in to the area, as it was believed by the Japanese at the time that if they didn't, European powers would. Even before the fall of the Qing, there had been a massive civil war (the Taiping War) that did a great deal of damage to the region.
China was also not an empire with a huge army after 1911 when much of the colonising was happening, as the dynasty had fallen and the region was split between the communists, the nationalists and various warlord parties for much of the first half of the 20th century.
A more important factor, and arguably the most important factor at least as far as Britain is concerned in regards to colonising China is that at the time this came up as a possibility, around the time of the Opium Wars, there was a lot of discussion back in London about how Britain was very much trying to avoid colonisation of China to the extent they had in India. It was more than they cared to be involved in, and despite a large number of people calling for war for various reasons, the government was wary of anything that would turn into any sort of large scale occupation.
So really, other East Asian countries were colonised, and often with quite devastating results to the local population. There's been a fair bit of romanticising Japan's colonisation of Taiwan, but this certainly wasn't the feeling people had at the time; it's largely revisionist thinking, and many Koreans and Chinese are still upset about the colonisation that occurred in the 19th and 20th centuries.