WHY DOES THE TORAH GIVE US THIS SPECIAL COMMANDMENT?
"...[G-d] loves the stranger, giving him food and clothing. You must also show love toward the stranger, for you were strangers in the land of Egypt." (Deut. 10:18-19)
STUDENT OF ABRAHAM
Maimonides wrote a response to a convert whose mentor insulted him and called him a fool for asking a legitimate question:
“...That which he called you a fool is very perplexing. One who left his father and mother, and his birthplace, and his nation, which is now in power, whose heart and mind led him to cling to a nation that is today detested by the nations of the world, ruled over by slaves, and to recognize and understand that their religion is the true and righteous one; one who understood the ways of Israel, and pursued G-d, and entered the path of holiness, and entered under the wings of the Divine presence, and sat at the dust of the feet of Moses, the master of all prophets; one who desires G-d's mitzvot, whose heart inspires him to draw close to bask in the light of life and to ascend to the level of angels, to rejoice and take pleasure in the rapture of the righteous; one who cast out this mundane world from his heart and did not follow vain and idle things - is a person who reached this lofty stature to be called a fool?
G-d has not designated you a fool, but rather an intelligent and wise and understanding individual, who proceeds on proper paths, the student of Abraham, who likewise left his father and birthplace to follow G-d. May He Who blessed Abraham, and rewarded him in this world and the next world, bless and reward you properly in this world and the next. May He lengthen your days, so that you will be able to teach G-d's laws to His congregation, and may you merit to see all the consolations in store for Israel in the future, and may the good that G-d will do for us also devolve upon you, for G-d has spoken good concerning Israel.”
HOLY SPARK
Through a proper halachic conversion, the convert transforms himself into a new individual. That spark of holiness is transformed into a Jewish soul and replaces his previous identity as a non-Jew. He is a newborn person with no halachic connection to his past.
G-d shows particular love and solicitude for the convert, feeding and clothing him. Food is man's basic necessity. Out of recognition of the elevated essence of the convert, G-d provides his essential necessities. Clothing represents one's honor. By providing clothing, G-d honors the convert.
STRANGERS IN EGYPT
On the one hand, we share an intrinsic affinity with that which the convert chose and accepted upon himself. Nevertheless, it is difficult to relate to the convert with a sense of total affinity, since his embrace of Torah and mitzvot was voluntary, and ours was by birth.
Therefore, the Torah could not merely exhort us to emulate G-d in loving the convert, since there is an impediment to actually fulfilling this command. Thus, the Torah adds, "for you were geirim in Egypt."
We can appreciate and identify with the convert, for in our national experience, we also were quasi-geirim when we left Egypt and accepted the Torah. Although we were already potentially Jews from the time of Abraham, and all that had to be done was bring out the potential that already existed at Sinai (see Gur Aryeh to Genesis 46:10), we experienced at Sinai a conversion, an acceptance of Torah and mitzvot not binding upon us at birth. Since we share that experience with the convert, we can be commanded to recognize and enhance that commonality.