Deuteronomy 24:22

And thou shalt remember that thou wast a bondman in the land of Egypt: therefore I command thee to do this thing.

The command to leave part of the harvest — grain and fruit and field gleanings — for the stranger, the fatherless, and the widow, and for poor and needy fellow Israelites generally, is grounded in Israel's memory of having been a bondman in Egypt, rather than claiming everything for themselves. This harvest law stands together with the prohibitions against perverting justice for the stranger and taking a widow's clothing as security. Remembering their own bondage and hardship, and God's mercy and redemption in delivering them, was to move them to kindness, generosity, compassion, and provision for the vulnerable instead of oppressing them.

The instruction taught them to use their means for the good of others. Practicing these laws would reflect God's character. The joy of harvest was to be joined with praise and thanksgiving for God's lovingkindness. God promised to bless them in keeping with their acts of love and mercy.

The blessings of salvation, temporal as well as spiritual, are for all mankind, for God is benevolent and never meant for misery and want to exist, nor for one person to have an abundance of luxuries while the children of others cry for bread, but has made ample provision for the wants of all and designs to supply the needs of all His creatures through His representatives to whom He has entrusted His goods. This was the kind of education given to the families of Israel: though as God's chosen people they were to stand distinct and holy, separate from the nations that did not know Him, they were to treat the stranger kindly, not look down on him because he was not of Israel, and love him because Christ died to save him as truly as He died to save Israel. Therefore at feasts of thanksgiving when recounting God's mercies the stranger was to be made welcome, and at harvest a portion was to be left in the field for the stranger and the poor, so that in this way strangers would also share in God's spiritual blessings, being received if they chose the society of those who knew and acknowledged Him, that they would learn the law of Jehovah and glorify Him by obedience.