What does the "lord of the flies" symbolize?
The symbol of the boar's head on a staff functions as a visual metaphor for the descent into bestiality on the part of Jack's group.
"When Jack defies Ralph’s authority, the boys follow Jack, degenerating into a savage tribe that kills Simon and Piggy and attempts to kill Ralph, who flees from them" (eNotes).
The boar's head is placed on a spear and so works as a simple indicator of the success of a hunt but also as a more complex symbolic device. Jack wants to hunt before the other boys do and his violent temperament only gains prominence as the novel goes on. Thus Jack's violent nature is symbolized, in part, by the bloody head of the boar, which is also referred to as "the lord of the flies." (Historically, the term is drawn from ancient texts and refers to Beelzebub, a Biblical figure).
Jack's differences from Ralph are also expressed through the bloody boar's head, especially when we consider how the blood of the boar is used to paint the faces of Jack and his followers. In this way, the savage costumes of Jack's group become vivid signs of allegiance (to Jack and to brute violence as a means of survival and as social hierarchy determinant).
Simon encounters the head of the beast in a passage that speaks to the underlying meaning not only of the boar's head on a spear but of the novel on the whole.
"Fancy thinking the Beast was something you could hunt and kill!" said the head. For a moment or two the forest and all the other dimly appreciated places echoed with the parody of laughter. "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?"
The novel rather directly engages with the idea of how social structure is possibly the only thing between humans and savagery. Take away the threat of punishment (so that violent behavior is no longer criminal) and murder begins to seem like an inevitability. The bestiality, epitomized by the bleeding head on a spear, is actualized and acted out by Jack's group.
"James Stern in a 1955 review for The New York Times Book Review wrote 'Lord of the Flies is an allegory on human society today, the novel's primary implication being that what we have come to call civilization is at best no more than skin deep'" (eNotes).
The evil that they feared was lurking on the island is an evil that they brought with them. As the above passage from the novel suggests, the Beast is not an outward evil but an inward one. It is a capacity for violence and cruelty.
In interviews, Golding confirms that the novel is an exploration of the human dark side and the human propensity for violence and/or savagery. However, Ralph does survive in the end. The voice of reason and compassion and, above all, civility, is not undone by the pack of blood-painted boys following Jack.
While Golding's vision is perhaps bleak, it is not without hope. Interestingly, the novel's central theme when simplified in one way may be that to be civilized when presented with other options is heroic.
If rationality and kindness are heroic, we might feel invited to rejoice at how these qualities have been embedded into our cultures of family and of law and order. Against our lesser nature, Golding's novel might suggest, mankind has built up a defense. By and large it seems to work. When that defense is removed, however, that lesser nature may come to dominate.
*Of course, these ideas are interpretations of the text intending to be faithful to the idea of what the text and its symbols communicates. Golding's views and the views inherent in the work are presented to us for consideration and can be accepted or rejected, in part or as a whole, according to our individual thinking.