When the Prince of Morocco first appears in Williams Shakespeare's The Merchant of Venice as a suitor to Portia, a beautiful and wealthy heiress, the Prince seems to want to impress her with his education and his appeal to women, even though Portia reminds him that it makes no difference:
Besides, the lottery of my destiny
Bars me the right of voluntary choosing (2.1.15-16).
In other words, the choice of a husband is not hers to make but is dependent on the choice that her suitor makes among the three caskets. Nevertheless, the Prince continues to plead his case by telling Portia how fearsome and fearless he is in battle.
This scene also affords Shakespeare an opportunity to tell the audience, through Portia, about one of the conditions that Portia's father imposed on her suitors. The requirement is that before a suitor can choose a casket, he must swear that if he chooses the wrong casket, he is "Never to speak to lady afterward / In way of marriage" (2.1.43-44). This seems rather a harsh condition, never to ask another woman to marry him, but it ensures that whoever wishes to marry Portia is, by virtue of sacrificing his future happiness, worthy of the opportunity to make a choice among the caskets and possibly be rewarded with Portia as his wife.
The scene ends with the Prince agreeing to swear to that condition and asking to be led to the caskets, but Portia tells him to return after dinner to make his choice.
It's not until six scenes later that the Prince is able to make his choice of one of the three caskets. This is when the audience learns about riddles inscribed on each of the caskets of gold, silver, and lead; the suitor will know if he's chosen the right casket because it will contain a picture of Portia.
The Prince immediately rejects the lead casket, which is inscribed, "Who chooseth me, must give and hazard all he hath" (2.7.9, 16). He has no intention of giving everything he has and risking his future for lead.
The Prince is intrigued by the inscription on the silver casket, "Who chooseth me, shall get as much as he deserves" (2.7.7, 23). He believes that he well and truly deserves Portia:
I do in birth deserve her, and in fortunes,
In graces, and in qualities of breeding.
But more than these, in love I do deserve.
The Prince also gives consideration to the gold casket, which is inscribed, "Who chooseth me, shall gain what many men desire" (2.7.5, 37). The Prince has no doubt that "all the world desires her" (2.7.38), since suitors come to Portia from all over the world and risk their futures and their fortunes simply for a chance to win her as their wife.
Rather than fully consider the implications of the inscriptions on each of the caskets, the Prince instead considers only the metal composition of the caskets. The lead casket is "too gross" (2.7.50), he says, to contain Portia's image. The Prince reasons that silver is "ten times undervalued to tried gold" (2.7.53), and that only a gold casket can contain the portrait of "an angel" (2.7.58) like Portia.
The Prince chooses the gold casket, opens it, and finds that it contains not Portia's picture but a rotting human skull and a scroll that reminds the Prince that "All that glisters is not gold" (2.7.66) and that "Gilded tombs do worms enfold" (2.7.70).