Genesis 44:2

And put my cup, the silver cup, in the sack’s mouth of the youngest, and his corn money. And he did according to the word that Joseph had spoken.

Joseph commanded his steward to secretly put his silver cup in the mouth of the youngest brother's sack and then send the brothers on their way. At the same time he had each man's corn money returned inside his sack. The cup was Joseph's own drinking vessel, of the sort used by kings and rulers and regarded as a sure detector of poison placed in drink.

It was hidden there as a deliberate test to learn whether the brothers still envied Benjamin as they had once envied Joseph. It was meant to give further proof of their true feelings toward Benjamin after Joseph had favored him at the feast by giving him five times as much food, to reveal whether envy and hatred still remained in them. That secret placement set up the steward's pursuit of them and his charge that they had rewarded evil for good. It led to the search beginning with the eldest sack and going down to the youngest, to the discovery of the cup in Benjamin's sack, and to the brothers' distressed return feeling God's hand against them for their past wickedness.