1. Ralph is fairly well-liked, especially at first, and Piggy always struggles to find acceptance. Piggy finds himself at the receiving end of the group's jokes almost from the first moment they gather:
“He’s not Fatty,” cried Ralph, “his real name’s Piggy!”
A storm of laughter arose and even the tiniest child joined in.
Meanwhile, Ralph is quickly established as their leader even though "what intelligence had been shown was traceable to Piggy while the most obvious leader was Jack." Ralph has charisma and holds the symbol of power in his hands:
“Him with the shell.”
“Let him be chief with the trumpet-thing.”
2. While Piggy struggles athletically and with his health, Ralph is agile and skilled at navigating the island. Piggy wears glasses, is overweight, and struggles with asthma, and the group taunts him with chants of "Sucks to your ass-mar!" Meanwhile, Ralph has a more athletic build:
You could see now that he might make a boxer...
When exploration groups are chosen, Ralph is quickly selected at least in part because he is capable of the athleticism required.
3. Piggy has insights and wisdom that Ralph lacks. Piggy claims that "Life...is scientific" and calculates their next best steps with a detached sense of reason. Ralph, on the other hand, is the voice piece of this reason since no one will listen to Piggy himself. But it is not Ralph who holds the highest cards in the deck of intelligent thought.
4. Piggy really doesn't change from the beginning of the book until his death. He realizes that he is an outsider, but this doesn't shape his vision for how the group should behave or silence him from speaking the truth. In his final words, Piggy is urging the group to see the reality of their situation:
“Which is better, law and rescue, or hunting and breaking things up?”
Ralph, on the other hand, grows into a more developed sense of wisdom through experience—and mistakes. It is Ralph who betrays Piggy right from the beginning, jokingly sharing that his name isn't "Fatty" but "Piggy," sacrificing the confidence Piggy has requested to earn himself favor from the group. Later in the plot, Ralph comes to value Piggy's wisdom.
5. Piggy never really determines the nuances of group behavior, and it costs him his life. It wasn't wise to openly challenge Jack's group so boldly. Jack, surrounded by his loyal followers, could not let Piggy's proclamations go unpunished. Roger, faithful to his alliance to Jack, kills Piggy with "delirious abandonment." Ralph, on the other hand, realizes his precarious situation near the end and goes into hiding:
There were many things he could do. He could climb a tree; but that was putting all his eggs in one basket. If he were detected, they had nothing more difficult to do than wait.
He narrowly escapes murder when an officer shows up on the beach to rescue him and the other survivors.