The boys are just a metaphor for humanity and their creation of society and civilization. They of course like many leaders and societies before them became extremely cruel. This is most likely what inspired him.
The conflict that most likely have inspired William Golding's examination of the boys' cruel behavior towards one another in <em>Lord of the Flies</em> is World War II.
The author experienced firsthand and was greatly involved in World War II. Therefore,this event had a profound effect on his views and also let him see how people can cruelly treat each other when their lives are at stake. This observation is reflected throughout the novel by giving the boys different point of views and behaviors.
controlling your mindset to a point where you could decide your own emotions, decide what you want others to portray from you, and just play with peoples mentality is a strategy all in itself.