The villain to whom Hamlet refers is a specific one, Claudius, his uncle, who has usurped the throne. Hamlet starts to speak in a general about Denmark because he has been reflecting on the state of the country. By adding the phrase “arrant knave,” Hamlet emphasizes this type of person’s bad qualities.
In Act I, Scene V, the Ghost of Hamlet’s father appeared to his son and told him that Claudius had killed him by pouring poison in his ear; seduced Queen Gertrude, Hamlet’s mother; and illegitimately occupied the throne of Denmark. Near the end of a long monologue and just before he says farewell as the dawn approaches, the Ghost bids Hamlet to do something and to remember him:
If thou hast nature in thee, bear it not;
Let not the royal bed of Denmark be
A couch for luxury and damned incest….
Adieu! Adieu! Hamlet, remember me.”
Taking this to heart, and sorely distressed, he vows to forget everything else and remember his father. Reflecting on the Ghost’s words, Hamlet rails against Gertrude and Claudius:
O most pernicious woman!
O villain, villain, smiling, damned villain!...
That one may smile, and smile, and be a villain;
At least, I am sure, it may be so in Denmark.
Horatio and Marcellus enter, and Hamlet tells them the “wonderful” news he has learned, swearing them to secrecy, saying “There’s ne’er a villain dwelling in all Denmark/ But he’s an arrant knave.”
Horatio replies that they don’t need a ghost to tell them that, implying that Hamlet is stating the obvious. Hamlet, thinking they are slighting him and disbelieving the Ghost, first suggests they shake hands and go their separate ways. They argue about being offended, and Hamlet says there is no offense, and that the Ghost is honest. While he understands they want to know what happened, instead he makes them swear on his sword that they will never tell anyone what they saw. Horatio, confused, exclaims “O day and night/ but this is wondrous strange!” Hamlet’s reaction is
And therefore as a stranger give it welcome
There are more things in heaven and earth, Horatio
Than are dreamt of in your philosophy.
Horatio’s overall reaction swings between disbelief and confusion. Hamlet tries to reassure him but also to encourage him to keep an open mind.