Golding loved island stories as a boy - especially 'Coral Island'. 'Coral Island' was published 100 years before Golding's book, and three young boys were shipwrecked on an island in the book. They had to to survive without any adults, but the book portrayed this as a pleasant experience with no trouble at all. Golding new that this was not/would not be the case. He wrote the novel to show his ideas about the darker side of human nature, using the same starting idea.
Golding taught at a public boys school, and realised that that behaviour of the boys did not reflect the behaviour of those in 'Coral Island'.
William Golding was in WW2, and witnessed much horror while doing so.
He was horrified at peoples capacity to harm other people…