Source vs residence
Thailand taxes income earned in Thailand (source). Most home countries tax their residents on worldwide income (residence). The tax treaty between your country and Thailand decides who gets the first bite — and how the other side gives credit.