The Ramayana of Valmiki opens its narrative proper with King Dasharatha of Ayodhya, aging and without an heir, performing a great sacrifice, the Putrakameshti yajna, to obtain sons. From the sacrificial fire, tradition holds, a divine being emerged bearing a bowl of sacred payasa, which Dasharatha divided among his three queens; from this, Kausalya bore Rama, Kaikeyi bore Bharata, and Sumitra bore the twins Lakshmana and Shatrughna.
The Ramayana frames Rama's birth from the outset as the answer to a specific cosmic need: the gods, oppressed by the demon king Ravana of Lanka, who had made himself invulnerable to gods and demons through austerity but had, in his pride, neglected to guard against a mere mortal, appealed to Vishnu, who agreed to incarnate as a human prince precisely in order to defeat him. Rama's birth is accordingly presented in the text not as an isolated royal event but as the deliberate beginning of a divine intervention whose full purpose only unfolds across the epic's later books.
Rama grew up in Ayodhya alongside his three brothers, trained in archery and statecraft by the sage Vishvamitra among others, before the events of his marriage to Sita and his subsequent fourteen year exile, which occupy the bulk of the epic's remaining narrative.