Hamlet is meta-drama: it's a play based on a play, and it has plays within its play. And everyone's a foil for Hamlet, even Greek allusions. Here, in this speech about an act of revenge during the Trojan War, Hamlet tries to get into character (as an avenger) by reciting it, but he can't finish it, and so the First Player takes over. The scene foreshadows Hamlet's indecision regarding the nature of revenge.
This speech in Act II, scene ii is an echo of the Ghosts' implicit instructions for Hamlet from Act I. Hamlet tells the Ghost: "Speak, I am bound to hear." As the Ghost is a theatrical Ghost, a kind of prologue Ghost, the Ghost speaks and expects Hamlet to take over by honoring his demand for revenge.
This speech is the same way: Hamlet begins, and the First Player takes over. One player incites another. Both speeches are about the nature of revenge. Instead of literal revenge, though, the First Player delivers a kind of verbal revenge against his audience (primarily Polonius, who will tell later Claudius), in hopes of eliciting a katharsis, the purgation of pity and fear. Remember, "the play's the thing to catch the conscience of the king."
All characters here are foils: Pyrrhus is a foil for Hamlet; Priam is a foil for Claudius. Here's the allusion: Achilles killed Hector, Priam's son. As revenge, Priam's son, Paris, had Achilles killed. Achilles' son, Pyrrhus, takes revenge for his father's death by killing Priam. It's the same father-son dynamic as that in Hamlet.
Pyrrrhus is very much like Hamlet, since both hesitate before vengeance. Pyrrhus swings his sword to kill Priam but misses. Then, after Priam falls to the ground, Pyrrhus butchers him while Priam's wife, Hecuba, looks on.
The analogy his clear: Hamlet will pause when trying to kill Claudius at prayer. He withdraws his dagger. Later, Hamlet will kill Claudius mercilessly while his mother, Gertrude, looks on, a literal and theatrical vengeance (bloodletting as performance). And Hamlet will butcher his victims, like Pyrrhus, having at least five people's blood on his hands by the end.
So, each hero pauses before revenge, possibly to weigh the consequences of his actions, but then, when each hero does kill, he becomes a killing machine ("blood will have blood").