The foundation (moolmantra) for Mahavira's practice of austerities (sadhana) was equanimity: the state of consciousness as experienced when there is no attachment or aversion is equanimity.
Bhagvan experienced that the root cause of sorrow is karma and seed of karma lies in attachment and aversion. Violence (himsa), untruth (asatya), theft (chourya), non-celibate state (abrahmacharya) and possessiveness (parigraha) are the result of attachment and aversion. They are there if there is attachment or aversion and not there in their absence.
In his twelve and a half years of penance, Bhagvan ate only on 350 days. The rest of the time was spent fasting.
He fasted continuously for six months. In the entire period of his practice of austerities, Mahavira did not sleep for more than forty-eight minutes. He never wore any clothes to protect him from cold or heat. He never sought refuge in times of difficulty. Ants bit him, mosquitoes troubled him and heat burnt his soles. But Bhagvan experienced all the difficulties as though there were none.
Innumerable challenges in the form of profit - gain, joy - sorrow, praise - abuse, respect - disrespect, life - death tested Mahavira.
But through each test Mahavira emerged the winner.
His spiritual practice of austerities to move beyond the bodily state had been successful. His spiritual practice for fearlessness had been successful. His spiritual practice for equanimity had been successful. In this stage of freedom from attachment and aversion, Mahavira had attained enlightenment (kaivalya).
He did not need the medium of knowledge. The utility of the senses, mind and intellect had been exhausted. For him everything was apparent. During the period of penance, Mahavira observed silence, aloof from activities and fully absorbed in meditation. On the completion of his practice of austerities, he explained the truth. He used contemporary language for his explanation. Even today his sermons are available in the language of his times, Prakrit.