But because consciousness is painful—soaked and steeped in pain and not steeped in pleasure—sentient beings do grow disillusioned with it. Being disillusioned, desire fades away. When desire fades away they are purified. This is a cause and reason for the purification of sentient beings.
Mahāli the Licchavi reports to the Buddha that the rival teacher Pūraṇa Kassapa asserts that there is no reason for beings to be either defiled or pure. The Buddha denies this, and goes on to explain how it happens.