Vanavasa

Vanavasa (वनवास) is a Sanskrit term meaning residence (vāsa) in a forest (vana). While it can be undertaken voluntarily, it usually carries a connotation of forced exile as a punishment. It commonly figures as a harsh penalty in ancient Hindu epics (such as the Ramayana and the Mahabharata) set in a time, thousands of years ago, when much of the Indian subcontinent was a wilderness.

When vanavasa is self-imposed, it can imply seclusion from worldly affairs to focus on spiritual matters, as in the case of ashrams (hermitages) established by ancient rishis (sages). When imposed as a punishment, it carries an implication of enforced isolation from society and exposure to life-threatening extreme situations (the elements and wildlife).

Ramayana
Rama is described to have undertaken a period of vanavasa for 14 years in the forest of Panchavati, accompanied by his wife Sita and younger brother, Lakshmana. This was invoked by Kaikeyi as one of her two boons from her husband, King Dasharatha, desiring her son Bharata to be the successor to the throne of Ayodhya.

Mahabharata
The Pandavas and Draupadi were exiled from the kingdom of Hastinapura by their cousin Duryodhana and his uncle Shakuni after they lost in a game of dice with them and their common wife, Draupadi, was humiliated in the court before the elders. A chapter in the epic is called the Arjuna-vanavasa parva, focussing on the experiences of Arjuna.