Chinese companies have several advantages going for them:-
Large domestic market
Skilled and educated workforce
Natural resources and good transport infrastructure
Loans / subsidies for investment
All of these lead to:-
Economies of scale - building your thousandth car is much cheaper than building your first; and
Short supply chains - building a smartphone becomes a lot cheaper when chips, cameras, screens and cases are all manufactured in the same country, perhaps even the same city.
And yes, China is a lot richer than Thailand, so they can take over the local market if they want to.