A simile is a comparison between two seemingly unlike things, using the word like or as to make the comparison. In chapter 1, Ralph compares sleep to a mirage:
Sleep enveloped him like the swathing mirages that were wrestling with the brilliance of the lagoon.
The simile in this comparison makes sleep seem fleeting and even imaginary. After all, who has time for sleep after being stranded on a deserted island? Later, Ralph looks out across the children in this same chapter and finds the twins:
The two boys, bullet-headed and with hair like tow, flung themselves down and lay grinning and panting at Ralph like dogs.
This comparison makes the twins seem friendly and loyal, which is fitting for their characterization throughout the book.
A metaphor is a more direct comparison, not using like or as. In chapter 2, the group pushes one boy to the front to speak:
He was a shrimp of a boy, about six years old, and one side of his face was blotted out by a mulberry-colored birthmark.
The young boy is compared here to a shrimp, meaning that he is small and weak. As he tries to speak, the assembly of boys laughs at him, and he begins to cry. In this same chapter, another metaphor is used to describe the sun:
The sun in the west was a drop of burning gold that slid nearer and nearer the sill of the world.
Comparing the sun to gold which is on fire presents a vivid imagery of the way it appears in the sky. It also creates a metaphor of the value of sunlight, for as it disappears, the group of boys face new challenges in the darkness.
Personification is giving human qualities to things that are not human. In chapter 1, a rock is given humanlike motions as the boys attempt to move it:
The great rock loitered, poised on one toe, decided not to return, moved through the air, fell, struck, turned over, leapt droning through the air and smashed a deep hole in the canopy of the forest.
The rock almost seems to dance here, considering its options as it balances "on one toe." It decides and leaps, which seems human-like.
This novel is full of incredible figurative language, which is one of the many reasons why readers are able to clearly visualize this wild island which the boys attempt to conquer.