Exodus 22:21 is one of the most repeated commands in the Torah: "Thou shalt neither vex a stranger, nor oppress him: for ye were strangers in the land of Egypt." The reason given is memory — Israel was commanded to let their own experience of displacement shape how they treated the displaced. The Hebrew word for stranger — ger — is the specific word for the foreigner residing among a people, the one who does not have the protection of kinship or citizenship. God places himself in particular relationship with this person.
Psalm 146:9 lists God's characteristic acts: "The LORD preserveth the strangers; he relieveth the fatherless and widow." The preservation of strangers is placed alongside the relief of orphans and widows — the three most vulnerable categories in the ancient Near East. The immigrant is not overlooked in God's concern. The stranger is specifically named as someone God actively preserves.
Commentary is from a charismatic Protestant perspective, drawing on KJV text and public-domain sources including Spurgeon, Andrew Murray, and Matthew Henry.