Social control theory is the idea that people voluntarily keep themselves from committing crimes or acting amorally because they have internalized this moral code from their community. A person's relationships (familial and communal), commitments, beliefs, etc. are what keep them in line. Social control theory suggests that without outside sources of proper socialization and social learning, people are free to pursue any activity they choose, criminal or otherwise. There are no social contracts to limit them.
In The Lord of the Flies, a group of British school boys are marooned on an island and must fend for themselves. There are no adults, so all parental and adult relative relationships as well as other authoritative relationships (teachers, police men, etc.) have all been removed, leaving the boys on their own. Without the outside social pressure from home, school, and community to act decently, the boys are free to act however they wish, and this freedom to act quickly turns into the decision to act wrongly.
At first the boys are somewhat able to hold on to what they have been taught by society, establishing rules of order (whoever holds the conch may speak), assigning responsibilities (tending a signal fire, building shelters, etc.), and resisting the desire to do harm (Roger is said to purposefully miss when he throws rocks at Henry because "Roger’s arm was conditioned by a civilization that knew nothing of him and was in ruins."). However, the longer the children are away from the influence of their community, the more their civilized behavior devolves. The signal fire is left unattended in favor of hunting, the rule of the conch is ignored, and several of the boys resort to beating, torture, and murder.
Just when it looks like the blood-thirsty, savage boys are going to claim Ralph as another victim, they are discovered by a naval officer. The cries of the hunters behind Ralph immediately cease at the sight of the adult and the ship behind him. Ralph, who had, like the other boys, entirely neglected his appearance without a second thought for his entire stay on the island, is suddenly struck with awareness of his unacceptably filthy appearance. The other boys are all silent, their weapons hanging limply in their hands. The officer asks how many of them their are and not one of them can answer, and one has even forgotten his own name. The officer gently chastises them for being British boys and fairing so badly on their own. At this point, Ralph, and eventually the rest of the boys, begin to cry for the "end of innocence"and "the darkness of a man's heart." It just takes the reemergence of an authority figure and his ship, pieces of a civilized environment the boys had left behind, to remind the children who they were and make them turn from savages back to little boys who committed terrible acts. Social control has been restored.