In the age of the Buddha, stringent Brahamanical rules and societal structure of class based hierarchies, were viewed as obstacles in the path to moksha, or liberation from samsara, the cycle of death and rebirth. Some of these schools of heterodox thoughts embraced asceticism as a form of religious life.
Ascetics, or Samanas (meaning "to strive", as in performing austerities), renounced Vedic society and culture as a reaction to the exclusive religious rights of the village Brahmins, and also renounced the role of a householder to eliminate karmic debts. Through rigorous asceticism, including include celibacy, bodily mortification, homelessness, mendicancy, and upavāsa (fasting) the samanas sought to attain moksha, or acquire siddhis (magical powers).
Thomas Kelly, says in his book "Sadhus: The Great Renouncers" draws an interesting portrait of Indian ascetics or Sadhus:
"Sadhus are an enigma to me, living the mystery of ancient questions that have no answers. Tricksters, derelicts, madmen, charlatans, wanderers, mystics and yogis, their boldly painted bodies confront us with essential questions at the heart of existence.... how they allowed their bodies to become symbols of the sacred- from walking around naked to remind us of our naked selves, to wearing ash to remind us what are bodies become, to dreadlocks to remind us of our natural wild natures devoid of social convention. Their bodies were texts, which spoke volumes regarding sacred symbolism. A sadhu’s body is a map of the Hindu universe, for the body is a microcosm of the cosmos. Like a canvas, the colour and painted symbols aid in purification, inspire, and remind of the timeless divine beyond body and form. The body is used to tell stories. As the sadhus works towards an egoless state, he becomes the very symbols he’s painted whether it be Shiva, Vishnu, or Rama, the colors refer to esoteric inner visions and possible alchemical states of consciousness. The real goal of a Sadhu is to achieve an attitude of non-attachment and transcendence of the physical body."