Sankhya Kārika
Karika 68
प्राप्ते शरीरभेदे चरितार्थत्वात्प्रधानविनिवृत्तौ। ऐकान्तिकमात्यन्तिकमुभयं कैवल्यमाप्नोति ॥६८॥
When time comes, it escapes from the body with a rupture as unmanifest material cause, the pradhana, withdraws itself. Having reached the goal that is both absolute and imperishable, it attains liberation.
How the purusha obtains final liberation, the kaivalya, is described here.