It's worth refreshing our memories with Israel's experience as immigrants in Egypt:
The Israelites . . . were fruitful, increased greatly, multiplied, and became extremely strong, so that the land was filled with them. Then a new king, who did not know about Joseph, came to power over Egypt. He said to his people, "Look at the Israelite people, more numerous and stronger than we are! Come, let's deal wisely with them. Otherwise, they will continue to multiply, and if a war breaks out, they will ally themselves with our enemies and fight against us and leave the country." So they put foremen over the Israelites to oppress them with hard labor. As a result they built Pithom and Rameses as store cities for Pharaoh. But the more the Egyptians oppressed them, the more they multiplied and spread. As a result the Egyptians loathed the Israelites, and they made the Israelites serve rigorously. They made their lives bitter by hard service with mortar and bricks and by all kinds of service in the fields. Every kind of service the Israelites were required to give was rigorous.Joseph, Jacob's (Israel's) son who became prime minister of Egypt and brought his family into the land, had served under one of the Hyksos Pharaohs. The Hyksos were a people from Asia who had swept into Egypt and took it over. Their capital in Egypt, Avaris (biblical Zoan), was situated in the province in the eastern Delta known in the Bible as Goshen—exactly where Joseph directed his family to settle and where he was serving. After Joseph and his brothers died and before Moses was born the Egyptians revolted against the Hyksos, drove them out of the land, invaded the lands bordering the eastern shore of the Mediterranean, and established a new dynasty. It is a Pharaoh (or perhaps two) of this new dynasty who outlines the policies toward the Israelites in Exodus 1.
The king of Egypt said to the Hebrew midwives, one of whom was named Shiphrah and the other Puah, "When you assist the Hebrew women in childbirth, observe at the delivery: If it is a son, kill him, but if it is a daughter, she may live." But the midwives feared God and did not do what the king of Egypt had told them; they let the boys live. . . . Then Pharaoh commanded all his people, "All sons that are born you must throw into the river, but all daughters you may let live" (Ex. 1:7-17, 22).
The Egyptians had for about 150 years been dominated by foreigners from southwest Asia, which just happens to be where Jacob's family had come from. Anti-immigrant sentiment could hardly have run higher, and in the eyes of the Egyptians, the sons of Israel were immigrants. Unlike in contemporary America, in nations of the ancient world (and in some countries today, not to mention slaves in antebellum America) citizenship was not based on the country of one's birth or a piece of paper, which would have made all the Israelis Egyptian citizens by this time. Rather, citizenship was based on ethnicity, culture, and language. So the Israelis could live in Egypt for many generations, all of them native-born, but as long as they still looked, talked, and acted like Israelis instead of Egyptians, as long as they had any cultural distinctives, they were immigrants.
Though the exact political situation and cultural relationships in Egypt were peculiar to that place and time and aren't the same as in the United States in 2010, it seems that worry about immigrants bears similar marks no matter where and when it appears. The Egyptians viewed Israel as a nation within their nation, its own enclave of foreigners who hadn't assimilated to the dominant culture properly. The Egyptians were deeply concerned about both the number of Israelis and the rate of their growth relative to the rest of the population. They could easily envision that if the present growth rate continued unabated then there would eventually be more of them than of Egyptians. Then the Egyptians would be the strangers in their own country; in fact, they would have no country left to them. The real Egypt would cease to be, replaced by a new country, Israel, located along the Nile. This process would of course be sped up if the Hyksos or some horde like them returned—wouldn't the Israelis naturally join forces with them because of their common ethnic and linguistic bonds? National security was at stake. (Note that the NET above and most versions mistranslate "and leave the country," which makes no sense in context. The Hebrew idiom there should be read [as in Hos. 1:11] "take possession of the country" or "overflow the country." See Stuart, 65.)
So, a fast-growing, insufficiently assimilating minority with a different language, look, and culture taking over the country so that it isn't ours anymore . . . sound familiar? It would have sounded familiar to Americans 100 years ago and 70 years before that too. And it could have become familiar to Israel newly settled in Canaan. After all, it was a land flowing with milk and honey, as the saying goes. God promised Israel that if they remained faithful to him he would bless them beyond their imagining. A land like that would be enormously attractive among their neighbors. It was not unreasonable to believe that as a result of that blessing there would be more Gentiles desiring to settle in Israel than Israelis living there!
And that was exactly the plan of God. This is what he chose Israel's ancestor Abraham for in the first place, that all nations would be blessed through him and his descendants (see also Gal. 3:8). While the pattern of evangelism in the New Testament is the people of God going out with the gospel into the world, the pattern in the Old Testament is for the world to come to the people of God, attracted by the immense and unique blessing poured out on them. Immigration to Israel was the way God was going to tell the Gentiles about himself. Were it not for this pesky problem called sin (whose intractability in the human heart God was in the process of pointing out to the human race through Israel's example), immigration was the way that God would save the world.
But one of the things necessary for the Gentiles to learn about Yahweh through Israel was that Israel would have to be an extraordinarily welcoming place to foreign immigrants. So they were supposed to treat Gentile immigrants like brothers, like fellow Israelis, like they themselves would want to be treated, like they wanted to be treated when they had loyally and peacefully resided in Egypt. Of course, the beauty of this is that by treating the Gentiles as beloved brothers from the get-go, they would soon become exactly that. Israelis were to treat Gentile immigrants as their own kin so that the Gentiles would worship the true God and obey his law just like the Israelis. The immigrants would be converted as they were being embraced.
But if Israel failed to obey what God had commanded, they would be prone to drift into the pattern the Egyptians had set. They would exploit immigrants for their cheap labor even as they resented their existence and eventually they might try to assimilate them by forced intermarriage (hence killing boys but leaving girls alive) and outright genocide. We don't have evidence that Israel went to that extreme. But we do see an interesting pattern in the reigns of David and Solomon. During their reigns Israel was never more blessed and thus never more attractive to its neighbors. But with blessing came building projects, and David and Solomon pressed Gentiles into service—a combination of the descendants of Canaanites conquered under Joshua, people who had moved to Israel voluntarily, and nations David had conquered. In other words, they did to the Gentiles living in their country the very thing the Egyptians did to the Israelis among them. The Davidic kings' agenda seemed to be more about the buildings than about the people, unlike the Pharaohs' intention. But as the Egyptians discovered, the policy of using immigrants for their easy labor made their assimilation even less likely. In Israel, this proved to be devastating. Rather than embrace the immigrant as a brother to lead him to Yahweh, by exploiting him as an outsider they reinforced his worship of his own idols. And then the attraction went in reverse—Israelis gave up their God for the Gentiles' gods instead of the other way around, and as God had promised, this led to Israel's utter ruin.
It is no small irony that David and Solomon oppressed immigrants in order to build the temple of Yahweh, where Solomon prayed that if a foreigner came from a distant land because of the glory of Yahweh's name, God would hear his prayer, and that in part because of that very oppression, foreigners came to that very temple to burn it to the ground (Jer. 7:1-15, note v. 6; Zech. 7:8-14, note v. 10).
As I concluded a previous post, I will save practical implementation for a later day. But for the moment let us soberly acknowledge the example of the Israelis. They were to treat immigrants, who were attracted to God's blessing on Israel, as Israel's immigrant ancestors wanted to be treated so that the newcomers might be led to worship the true God. But because they followed the example of their former, fearful Egyptian oppressors, treating immigrants as outsiders and using them for cheap labor, Israel drew away from God and was destroyed.