He who knows Brahman, attains the highest. Moksa is the absence of false knowledge says Padmapada. This insight, this changed attitude to life and its happenings is not so much a condition of Moksa, as Moksa itself. The cause of pain is simply error or false knowledge. The Jaina term for Avidya is Mithyatva.
Knowledge downs only after the destruction of darkness.
So the path of freedom is the path of knowledge. The soul is inherently perfect and has infinite potentiality. It is self luminous. It shines as the sun. But there are clouds and fogs of Karma.