The Israelites were slaves in Egypt. They prayed for freedom and God heard their prayers. He appeared to Moses and appointed him to deliver the people.
Then the LORD said, “I have surely seen the affliction of my people who are in Egypt and have heard their cry because of their taskmasters. I know their sufferings, and I have come down to deliver them out of the hand of the Egyptians and to bring them up out of that land to a good and broad land, a land flowing with milk and honey, to the place of the Canaanites, the Hittites, the Amorites, the Perizzites, the Hivites, and the Jebusites. And now, behold, the cry of the people of Israel has come to me, and I have also seen the oppression with which the Egyptians oppress them.Come, I will send you to Pharaoh that you may bring my people, the children of Israel, out of Egypt.” (Exodus 13:7-10)