In Buddhism, detachment is the opposite of attachment, craving, desire, which is the cause of all suffering.

Detachment, end of craving, stops the cause of suffering, and, hence, frees one from samsara.