The theme of the book, "Ramayana," is virtue, honesty, and integrity, will always result in goodness for the person who posses these qualities.
The main character of the book, Rama, from the time he was born, was dedicated to virtue, religion, and honesty, and no matter what happened to him, whether good or bad, he wouldn't break from his religion, or insult or hurt the person, unless they did something to provoke the gods, or they did something that was not virtuous. Throughout the book, Rama was helped, and assisted by the gods, because of his virtuous actions.