When Jacob heard that there was grain available in Egypt, he said to his sons, "Why are you standing around looking at one another?
I have heard there is grain in Egypt. Go down and buy some for us before we all starve to death."
So Joseph's ten older brothers went down to Egypt to buy grain.
Jacob wouldn't let Joseph's younger brother, Benjamin, go with them, however, for fear some harm might come to him.
So Jacob's sons arrived in Egypt along with others to buy food, for the famine had reached Canaan as well.
References for Genesis 42:5
Since Joseph was governor of all Egypt and in charge of the sale of the grain, it was to him that his brothers came. They bowed low before him, with their faces to the ground.
Joseph recognized them instantly, but he pretended to be a stranger. "Where are you from?" he demanded roughly. "From the land of Canaan," they replied. "We have come to buy grain."
Joseph's brothers didn't recognize him, but Joseph recognized them.
And he remembered the dreams he had had many years before. He said to them, "You are spies! You have come to see how vulnerable our land has become."
"No, my lord!" they exclaimed. "We have come to buy food.
We are all brothers and honest men, sir! We are not spies!"
"Yes, you are!" he insisted. "You have come to discover how vulnerable the famine has made us."
"Sir," they said, "there are twelve of us brothers, and our father is in the land of Canaan. Our youngest brother is there with our father, and one of our brothers is no longer with us."
But Joseph insisted, "As I said, you are spies!
This is how I will test your story. I swear by the life of Pharaoh that you will not leave Egypt unless your youngest brother comes here.
One of you go and get your brother! I'll keep the rest of you here, bound in prison. Then we'll find out whether or not your story is true. If it turns out that you don't have a younger brother, then I'll know you are spies."
So he put them all in prison for three days.
On the third day Joseph said to them, "I am a God-fearing man. If you do as I say, you will live.
We'll see how honorable you really are. Only one of you will remain in the prison. The rest of you may go on home with grain for your families.
But bring your youngest brother back to me. In this way, I will know whether or not you are telling me the truth. If you are, I will spare you." To this they agreed.
Speaking among themselves, they said, "This has all happened because of what we did to Joseph long ago. We saw his terror and anguish and heard his pleadings, but we wouldn't listen. That's why this trouble has come upon us."
"Didn't I tell you not to do it?" Reuben asked. "But you wouldn't listen. And now we are going to die because we murdered him."
Of course, they didn't know that Joseph understood them as he was standing there, for he had been speaking to them through an interpreter.
Now he left the room and found a place where he could weep. Returning, he talked some more with them. He then chose Simeon from among them and had him tied up right before their eyes.
Joseph then ordered his servants to fill the men's sacks with grain, but he also gave secret instructions to return each brother's payment at the top of his sack. He also gave them provisions for their journey.
So they loaded up their donkeys with the grain and started for home.
But when they stopped for the night and one of them opened his sack to get some grain to feed the donkeys, he found his money in the sack.
"Look!" he exclaimed to his brothers. "My money is here in my sack!" They were filled with terror and said to each other, "What has God done to us?"
So they came to their father, Jacob, in the land of Canaan and told him all that had happened.
"The man who is ruler over the land spoke very roughly to us," they told him. "He took us for spies.
But we said, 'We are honest men, not spies.
We are twelve brothers, sons of one father; one brother has disappeared, and the youngest is with our father in the land of Canaan.'
Then the man, the ruler of the land, told us, 'This is the way I will find out if you are honest men. Leave one of your brothers here with me, and take grain for your families and go on home.
But bring your youngest brother back to me. Then I will know that you are honest men and not spies. If you prove to be what you say, then I will give you back your brother, and you may come as often as you like to buy grain.'"
As they emptied out the sacks, there at the top of each one was the bag of money paid for the grain. Terror gripped them, as it did their father.
Jacob exclaimed, "You have deprived me of my children! Joseph has disappeared, Simeon is gone, and now you want to take Benjamin, too. Everything is going against me!"
Then Reuben said to his father, "You may kill my two sons if I don't bring Benjamin back to you. I'll be responsible for him."
But Jacob replied, "My son will not go down with you, for his brother Joseph is dead, and he alone is left of his mother's children. If anything should happen to him, you would bring my gray head down to the grave in deep sorrow."