"Then a new king, who did not know about Joseph, came to power in Egypt. 'Look,' he said to his people, 'the Israelites have become much too numerous for us. Come, we must deal shrewdly with them or they will become even more numerous and, if war breaks out will join our enemies, fight against us and leave the country.'" NIV translation
As life continued in Egypt the old king that had shown Joseph favor died and was replaced. This new king did not know what Joseph had done for Egypt and thought of the Israelites as possible enemies. This ignorance of what Joseph had done for them brought fear and this fear caused the Egyptians to change from being a refuge to becoming a prison for the Israelites. The same thing can happen in our walk with the Lord (if we allow it). Fear is not of God and, if we let it into our hearts, it can lead us to do things that we would not normally do. When we face troubles, our reaction can be to remember what God has already done on our behalf and have faith in Him or we can act in fear on our own.
"So they put slave masters over them to oppress them with forced labor, and they built Pithom and Rameses as store cities for Pharaoh. But the more they were oppressed, the more they multiplied and spread; so the Egyptians came to dread the Israelites and worked them ruthlessly. They made their lives bitter with hard labor in brick and mortar and with all kinds of work in the fields; in all their hard labor the Egyptians used them ruthlessly." NIV translation
Fear makes men do some very evil things and here we see that the Egyptians' fear drove them to abuse the people of God.
We might ask the question: Why would God allow this? We can look back and see that God was at work in growing His people but, at the time, they had to have been wondering what had happened and whether God had abandoned them.
This same type of persecution has come before many large moves of God. We saw this same thing happen in Jerusalem after the death of Jesus Christ. God had the disciples concentrated around Jerusalem for a time to grow but, at the proper time, God allowed them to be persecuted in order to get them to leave their refuge and spread the gospel of Jesus Christ. The same pattern is happening even now as it seems that persecution of Christians is happening all over the world. The bad news is that this will get worse but the good news is that a major move of God follows these periods of severe persecution. We will see this again with the 144,000 witnesses and the great revival that is described in Revelation 7.