Defection
Defectionis a term that means to change sides. This is usually used in the context of the change of allegiance, duty or loyalty particularly in a political context. In a religious context defection is known as apostasy.
The word is often associated with the Cold War when individuals would defect from say Russia or East Germany to the West, although some traitors also moved the opposite way from the United States or United Kingdom. Defectors often supplied valuable intelligence to the opposition and intelligence agencies often tried to delay their defection for as long as possible. As a reward they would often be given a house and job in their adopted country but ultimately they often ended up sad and lonely in their new home.
Defection can also means failure, lack, or loss: e.g. He was overcome by a sudden defection of humor.