This speech in Hamlet is spoken, of course, by Hamlet after the Player King has delivered his moving monologue about Hecuba. Thisis an ancient tale, and, while it'sa tragic story, the characters and events of this story are nothing personal to the actor. Still, the Player King is moved to tears as he tells the story. Hamlet's speech which follows is generally known as the "rogue and peasant slave" soliloquy. In it, Hamlet has two key themes. First, he berates himself for his comparative lack of emotion even for a just and personal cause and is amazed at the actor's ability to create such emotion for something totally disconnected from his life. He says:
O, what a rogue and peasant slave am I!
Is it not monstrous that this player here,
But in a fiction, in a dream of passion,
Could force his soul so to his own conceit
That from her working all his visage wann'd,
Tears in his eyes, distraction in's aspect,
A broken voice, and his whole function suiting
With forms to his conceit? and all for nothing!
What's Hecuba to him, or he to Hecuba,
That he should weep for her?
Next, Hamlet notes that if this actor had half the reason, the "motive and cue for passion," that he did, he would be a rather wild man on stage, confounding all with his emotions and actions. Yet, Hamlet says, he "can say nothing"--not even against a king who has usurped the throne by killing his own brother. He says he deserves all insults of word and deed for this lack of resolve and passion. He continues his diatribe against himself:
Why, what an ass am I! This is most brave,
That I, the son of a dear father murder'd,
Prompted to my revenge by heaven and hell,
Must, like a whore, unpack my heart with words,
And fall a-cursing, like a very drab,
Then comes the second portion of this soliloquy in which Hamlet makes a plan. "About, my brain!" he says, and then he determines to reaffirm the King's guilt by enacting a play within a play (within a play, actually)--inserting a few lines into the play in order to catch the King off guard and ensure himself of Claudius's guilt.
I'll have these players
Play something like the murder of my father
Before mine uncle: I'll observe his looks;
I'll tent him to the quick: if he but blench,
I know my course.
In the end, Hamlet has--once again--made a plan to determine once and for all:
...the play 's the thing
Wherein I'll catch the conscience of the king.
The player continues to recite the lines of a speech that Hamlet remembered about Priam's slaughter. Priam was the king of Troy. Hecuba was his wife who witnessed Priam being hacked to death by the Greek Pyrrhus, the avenging son of Achilles.
The speech made by the player is important for several reasons. It involves the assassination of a king by an avenging son. This assassination is witnessed by the Queen. Two parallels can be drawn here. First, Claudius, like Pyrrhus, assassinated the king of Denmark. Gertrude mourned for her husband as Hecuba did for hers. Hecuba was taken prisoner by the Greeks, and was according to some versions, able to exact revenge on her captors.
Secondly, Hamlet, like Pyrrhus, is an avenging son just as Pyrrhus was. He is contemplating an assassination as well: Claudius. Here the Queen may be present. So in listening to this account, we are not sure whether Hamlet wants to be reminded of the assassination of his father or of the assassination of Claudius that he about to commit. Probably both.
Yet in is soliloquy it is the actor who recites the lines about Hecuba and is so moved by the lines that Hamlet particularly admires:
What's Hecuba to him or he to her,
That he should weep for her.
It seems that Hamlet most admires the emotion that the actor is able to display. This line is particularly telling since it shows that Hamlet is struggling to feel the passion needed for the revenge he is contemplating. Although he hates Claudius, assassination is not an action that he has the stomach for. In fact, this whole soliloquy is an attempt by Hamlet to generate the needed anger necessary to commit such an extraordinary act.
The Hecuba speech, as you term it, in Shakespeare's Hamlet, shows Hamlet feeling rebuffed by the actor who can reveal such powerful emotion when presenting only a fiction.
The actor is only acting out a fictional story, but he displays powerful emotion while doing so. Hamlet feels rebuffed by this. He, he says, has actual motives for acting: the murder of a beloved father and a hasty and incestuous remarriage by his mother. Not to mention the usurping of the throne that should have been his, although this doesn't seem to bother Hamlet. Yet, the actor demonstrates certainty and powerful emotion during his acting display, while Hamlet, in the first part of this speech, raves against himself for not doing anything.
That is the purpose of the Hecuba part of the speech.
Of course, the second part reveals the more rational side of Hamlet's personality. In it Hamlet makes his plan to catch the conscience of the king, as he says. He plans to use the players to make Claudius reveal his guilt in the killing of King Hamlet.
Thus, we see Hamlet looking at two sides of the same situation. We see him condemn himself for being a coward and not acting, yet we also see why he has not acted. To kill a king (Claudius) is no small thing, and Hamlet needs more than the word of a ghost that could, indeed, be the ghost of Hamlet's father, but could also be a demon bent on leading Hamlet to destruction.