The terrain between India and Thailand was mostly rough terrain and dense jungle, with population living in valleys along the rivers. The Burmese were though fighters, they had been fighting the Thais for centuries. So invading from the direction of India not exactly a walk in the park.
On the other side was France busy colonizing, in Vietnam, Cambodia and Laos. Thailand had the luck of laying exactly on the edge where both zones met. They had capable kings (Kings Rama IV and V) who played off both colonial powers against each other. That's why they were able to stay independent.
Burma didn't have that luck. Their country was firmly withing the zone of British influence. They also had the bad luck of having quarrels within the royal family that didn't help them but were very helpful for the British.
In a nutshell:
The Thais and the Burmese had been fighting against each other for centuries. Both were pretty aggressive and capable fighters. Invading Burma was very difficult due to long communication lines, difficult terrain and dense jungle.
The people who already lived there were very warlike, had centuries of experience in fighting in exactly that terrain. They also had much shorter communication lines.
And on the other side was France busy colonizing.