Famine hit the land, and because of Joseph, Egypt had plenty of food. Jacob somehow found out and sent ten of his sons with money to get some for their family. That's when Joseph's dreams came true, and his brothers bowed before him. He recognized them, but he concealed his identity. He put them in a situation to make them remember their crime of selling him into slavery; they became very regretful because they understood that God was now punishing them for their sin. But they weren't being punished, although it felt like it was because of their guilt and because Joseph put them in jail for three days! He put them there to bring them into submission, not as revenge. Joseph wanted to see Benjamin, whom they had left behind, because Jacob wouldn't let him go. He concocted a plan to get them to bring him. Joseph kept Simeon and bound him before their eyes as a deposit. On their way home to get Benjamin, they discovered the Egyptians gave them back all their money, frightening them even more. It is a fearful thing to fall into the hands of the living God. When you feel guilty, it's hard to rejoice in the good things God does for us; that's why we must humble ourselves before Him and repent. The more I read the Old Testament, the more thankful I am for Jesus and his gift of salvation. We cannot outgive him! We commit all these crimes against him, and he forgives us and then gives us more like Joseph giving his brothers back their money.
And he said unto his brethren, My money is restored; and, lo, it is even in my sack: and their heart failed them, and they were afraid, saying one to another, What is this that God hath done unto us? Genesis 42:28