How does Ralph learn of Jack’s plans for him?
Ralph learns, from Jack himself, at the end of chapter 11, what his intentions are. After Piggy's death, when Roger released a huge rock that knocked him to his death forty feet below, Jack screamed wildly at him:
“See? See? That’s what you’ll get! I meant that! There isn’t a tribe for you any more! The conch is gone—”
This means that Jack intends for Ralph to meet his end in a similar way. He states that he means it and essentially banishes Ralph by saying that there is no tribe for him anymore. He later ensures the truth of this statement by capturing Sam and Eric. His reference to the conch also suggests that there are no rules any longer - unbridled savagery and chaos has become the norm.
In chapter 12, Ralph realizes that he has become an outcast and that:
These painted savages would go further and further. Then there was that indefinable connection between himself and Jack; who therefore would never let him alone; never.
He would, therefore, never be free of Jack. He later learns, to his dismay, from Sam and Eric, that Jack has planned to hunt him down like a pig. The boys are 'going to spread out in a line across the island' looking for him until they find him and that they were going to 'do' him. This implies that he will be killed.
Furthermore, Sam and Eric tell him that Roger had sharpened a stick on both ends. The image that this conveys is a terrifying one and stays with Ralph all through his desperate attempts to avoid discovery. It indicates that Roger has prepared a stick on which his head will be impaled and the other end stuck into the ground, just as Jack had previously done after he had slaughtered a pig and decapitated it.
Ralph learns of Jack's specific plans for him from Sam and Eric. In chapter 12, when Ralph is on the run after Piggy was killed, he encounters the twins. They are terrified and they are in Jack's tribe now, but not by choice. They have been tortured and forced to be part of Jack's tribe.
Ralph notes, however, that they are not painted, indicating that they haven't reached the full savagery of those who are painting their faces. Because they aren't fully savage, they have enough civilization in them to warn Ralph of Jack's plans. They tell Ralph to run and be gone for good.
They tell him that Jack and the others plan to "do" him, meaning they plan to kill him like he's a pig. They've been told already how to hunt for Ralph and how to throw their spears at him. Ralph asks them what Jack plans to do with him once Jack has caught him.
Sam and Eric tell Ralph that Roger has sharpened a stick at both ends. That's what Jack did when he cut off the head of the sow and put it on the sharpened stick, then stuck the stick into the ground. Clearly, that's what Roger has planned for Ralph when Jack and the tribe catch him. With that news, Ralph runs away.