They know easily because as a foreigner you are required to carry your passport. And if you are not a tourist (again see your visa or stamp in your passport), you are required to have a Thai licence. Eg, Long term Visa or Retirement/ Marriage visa or extension then you are not a tourist.
That is exactly how Wise works. They do not move money between countries. They make their profit by taking one currency from you and giving you funds from their Thai bank.