The line to which you refer in The Merchant of Venice by William Shakespeare is found in a speech by the Moor, a dark-skinned prince who hopes to have a chance to win Portia's hand (and no doubt her fortune) in marriage. Before this line, he asks Portia not to discount him as a suitor because he is dark-skinned; she assures the prince that she likes him as well as any of the other suitors but of course is not allowed to have a say in who she marries.
The Moor asks for the caskets (boxes) to brought to him so he can choose one, hoping it will be the one which wins him Portia's hand. (She is bound by her father's will to marry whoever chooses the correct box, remember.)
After asking for the boxes, the Moor says these lines:
By this scimitar,—
That slew the Sophy, and a Persian prince
That won three fields of Sultan Solyman,—
I would outstare the sternest eyes that look,
Outbrave the heart most daring on the earth,
Pluck the young sucking cubs from the she-bear,
Yea, mock the lion when he roars for prey,
To win thee, lady.
He says he has fought bravely in battle before and, to win her, he would do so again. He would outsmart and outbrave the wisest and most daring opposition, he would take a mother bear's baby cubs from her, and he would face a lion who is roaring directly at him and hoping to eat him--all to win Portia. So, the line you wonder ask about is paraphrased as facing a hungry lion without fear.
Alas, he continues, the boxes rely on chance rather than bravery, so he will not get a chance to win her through valor and will now have the same odds of winning as a servant or a scoundrel.