20 years later and you amass a small fortune the thai wife turns up in the UK and goes to a solicitor wanting half, then it's real, a marriage outside of the UK is real in the UK, I know, and so is any assets!
If its the 5 year come and go vise then on a permanent stay you check in, if you leave and return that is your check in with immigration and should re start the 90 days, it's your length of stay in the country from point of entry when each 90 days starts and ends.