I assume you are referring to the end of the story when you ask about the action that Ralph takes. Ralph runs after Piggy is killed because he fears he will be killed, too. The boys on the island have turned savage now. Ralph has to run and hide like a pig being hunted for food, in fact, he begins to think like a hunted animal because that is essentially what he is. He hides among the jungle's foliage. Jack's plan for Ralph is to kill him. When Ralph encounters Samneric in the jungle as he's hiding, they tell him that Jack has already told him that they are going to hunt for Ralph like a pig. They are to throw their spears like he is a pig and they are going to spread out in a line across the island hunting for Ralph. Jack sees Ralph as the one remaining threat and symbol of their former society and civilization, therefore, one who must be eliminated. Ralph knows his only hope for survival is to run and hide.