Every night of Succot we welcome into the succah one of the Ushpizin, the seven mystical visitors. They are Abraham (the fist night's visitor), Isaac, Jacob, Joseph, Moses, Aaron and David.
Ushpizin means guest in Aramaic. Each night a prayer is said to welcome the appropriate guest. Apparently, the earliest source for the custom of welcoming the Ushpizin is in the Zohar, the classic of Kabbalah.
The Zohar makes clear that the main reason for the custom is to sensitise us to the importance of inviting guests to share the holiday with us: "One must also gladden the poor, and the portion [that would otherwise have been set aside for these Ushpizin guests] should go to the poor. For if a person sits in the shadow of faith and invites those guests and does not give their portion [to the poor], they all remain distant from him."
Maimonides writes that a Yomtov meal that you do not share with the needy and bitter of spirit is not rejoicing in a mitzvah, but merely rejoicing for your stomach. But on Succot, after we have tried on Yom Kippur to overcome the sins that divide us from others, togetherness is a particular theme and there is an extra reason to have guests. As the Talmud says: "Would that all Israel could dwell together in one succah."