Ravanais one of the principal demons in Hindu mythology who battled against the popular avatar, Rama. Ravana plays a prominent role in the famous Hindu epic, the Ramayana, where, as the king of Lanka, he is both the overlord of the army of Rakshasas (demons) and the abductor of Sita, the wife of Rama.
Ravana's arrogance towards the gods, and improper behavior towards Sita, sets in motion a chain of events that culminates in an epic battle between Ravana and Rama. His paramount ambition is to overpower and dominate the devas. His ten heads represent his knowledge of the six shastras and the four Vedas. However, Ravana was a tragic figure who engendered his own demise with his unfettered sexual desire and his imperious militarism.
Ravana is depicted as having ten heads, although sometimes he is shown with only nine heads because he has sacrificed a head to convince Shiva. However some story in Java told that every year Ravana cut one of his head every year and present it to Shiva as representative of his devotion. Each head was reflecting his desire. By cut it and present it, he was sacrificing one of his many desires to appease Shiva. He kept doing it every year until the last one. Turned out the last head was considered as the true head of Ravana and Shiva considered his devoutness is a worthy one and his sacrifices were accepted.
For several years he sang songs praising Shiva, until the destroyer god released him from his bondage. Pleased with his bravery and devotion, Shiva granted Ravana further strength, awarding him the Chandrahas (or "Moon-blade"), an immensely powerful sword. Ravana in turn became a lifelong devotee of Lord Shiva. It is also during this incident that Ravana officially acquired his name, which was given to him by Shiva. Ravana's abilities were by now truly awe-inspiring, and so he set out confidently on a series of campaigns to conquer human and celestial beings alike. After vanquishing several kingdoms of the human world, he performed the suitable sacrifices and was crowned emperor.
After overcoming numerous arduous challenges, Rama entered into Lanka in order to confront Ravana and rescue his wife. Rama offered Ravana a final chance to make peace but refused. On the battlefield, Rama alongside Hanuman slew the most powerful rakshasa commanders, along with hundreds of thousands of rakshasa soldiers, aided by the Vanaras, a race of monkey-men who fought alongside him. With his rakshasas neutralized, Ravana was forced to square off against Rama. In their initial battle, Ravana was severely injured, and his chariot and weapons were destroyed. Due to this injury, Rama allowed Ravana to live and return to fight another day. In their next meeting, Ravana unleashed the full extent of his magical abilities while making full use of the boons given to him by Shiva and Brahma. After a drawn-out battle, Rama successfully decapitated Ravana's central head.