Defection is when a person leaves their home country in a way the home country claims to be illegal. To the first country, they can be seen as traitors.It is a political label used by authoritarian countries.
More broadly, it involves abandoning a person, cause, or doctrine to which one is bound by some tie. The tie may be one of allegiance or of duty.