Once upon a time the Cantonese and Hakka tin miners were having an all-out war in Perak, the Brits had to intervene to calm the situation down.
And that's why Selangor, Perak, KL etc have plenty of Cantonese and Hakkas, the Hokkiens settled at the coastal port cities, and the Teochews flocked to Bangkok for whatever reason.