The core mechanism is straightforward: a country offers the right to live there to overseas buyers who commit a minimum sum in housing. The minimum investment is set very differently across programmes, and buy property in thira legislators adjust it regularly.
An important distinction divides the right to reside and naturalisation. A residence permit gives you the right to live in the country, usually with renewals, but a passport generally takes years of actual residence. Any offer of nationality simply for a property deal is reason for caution.
Past the headline threshold, programmes impose further conditions. Frequent requirements involve a police clearance certificate, private health insurance, evidence of sufficient means and a required physical presence on local soil annually. Missing a single condition can cost you the residency even if the property is still yours.
Tax residency is a separate question entirely. Owning property does not necessarily make you liable for local income tax, though crossing the day-count threshold often does. Many countries apply a residence test based on days, and the effects reach earnings from abroad.
A sensible approach is essentially straightforward: pick a guzelyurt property for sale you would want anyway, and treat the permit as a bonus. Such schemes close from time to time, and an apartment bought only for paperwork proves difficult to let and difficult to sell.