This realization is shown through Ralph's attention to the fire, & his anger at Jack's insistence on hunting over all else. When Jack returns with a pig, Ralph is furious that the fire has gone out. In the meantime, he had seen a ship, & if the fire had been burning they could have been rescued. Jack doesn't see the importance of this, but Ralph knows that the fire is their only hope of survival. If they remain on the island, they run the risk of losing not just their connection to civilization, but their lives as well.
Golding also reveals this through Ralph's gradual descent into savagery. Although not as permanently as the others (especially Jack and Roger), Ralph himself gives in to the evil loosed upon the island. He recognizes and accepts his part in Simon's death, not deluding himself with rationalizations like Piggy does. From that moment, he attempts to distance himself from the rest of the boys, yet he also tries to win the other boys back over to his side. This fails miserably, & in the end, he is the only one standing against the evil within them all.