William Golding wrote Lord of the Flies in response to R.M. Ballantyne's novel Coral Island. In Coral Island, a group of schoolboys stranded on a deserted island manage to create a commendable, orderly society. Golding did not think this was realistic. Having recently lived through the years of World War II, Golding's view of man's trajectory was far less optimistic than Ballantyne's.
Lord of the Flies illustrates that evil is inherent in man. The best quote to illustrate this comes from the scene from which the title of the book is taken. When Simon, the spiritually sensitive boy, has a vision of the Lord of the Flies, the quintessential symbol of evil, the "Beast" tells him, "You knew, didn't you? I'm part of you? Close, close, close! I'm the reason why it's no go? Why things are the way they are?" This presents the view that evil is inherent in human beings, even in Simon, who of all the boys has the most loving, gentle, altruistic personality.
The characters of Roger and Jack also support Golding's proposition that evil comes from within. Roger seems to be a natural bully. He gleefully destroys the littluns' sandcastles and only fails to hit Henry with the rocks he throws at him because of respect for a "taboo," not because he has any compunction about hurting others. Indeed, he takes great pleasure in providing the death stab to the sow, and later all outer constraints on his behavior disappear, causing him to whiz rocks at Ralph from Castle Rock, to dislodge the rock that causes Piggy to fall to his death, and to "sharpen a stick at both ends" with the purpose of hunting and killing Ralph. Jack also succumbs easily to his feelings of jealousy and lust for power, descending into savagery, denying the other boys their rights, and instigating a tribal dance that ends up murdering Simon.
Ralph is the character who shows that, despite having internal tendencies toward evil, one can choose to follow the good and control the evil. He has the same temptations toward savagery as the other boys. When the boys have a mock pig hunt with Robert as the pig, Ralph finds the urge to pinch and hurt almost irresistible. He gets excited when his spear hits a boar, and of course, he takes part in the murderous frenzy of Jack's dance. However, he fights those urges and chooses to devote himself to actions that will help others, not hurt them.
Golding's characters reveal that evil is inherent within mankind, but that man can choose whether to give himself to evil or whether to pursue good. Roger and Jack choose to follow their evil impulses, while Ralph, for the most part, chooses to keep his under control.