Side switching by armed groups is a prominent feature of many civil wars. Shifts in alignment have far-reaching consequences, influencing key outcomes such as civil war duration and termination, military effectiveness, levels of civilian victimization, and state-building prospects. In Sudan's wars, ideological and ethnic cleavages have not influenced factional alignments nearly as much as one might expect given the prominence of clashing political projects and ethnically organized violence in southern Sudan and Darfur. Recent explanations highlighting the role of territorial control, factional infighting, or relative power considerations also have limited value. In many wars fought in weak states characterized by low barriers to side switching, two mechanisms explain patterns of collaboration and defection: first, political rivalries that lead actors to collaborate in exchange for military support in localized struggles; and second, patronage-based incentives that induce collaboration for material gain. A nested analysis drawing on original data from wars in southern Sudan and Darfur supports this argument. The findings have implications for understanding alignments in civil wars, the role of weak states in counterinsurgency, and ethnic politics more generally, as well as policy relevance for factionalized civil wars.