To begin with we start with the Mishnah, we states that everyone must drink four cups of wine - even someone too poor to afford it. Our purposes is to discover the origins of this ritual.
(א) ערבי פסחים סמוך למנחה לא יאכל אדם עד שתחשך. ואפלו עני שבישראל לא יאכל עד שיסב. ולא יפחתו לו מארבעה כוסות של יין, ואפלו מן התמחוי.
(1) On the eve of Passover [from] close to [the time of] the afternoon offering, no one must eat until nightfall. Even the poorest person in Israel must not eat [on the night of Passover] unless he reclines. And they must give him no fewer than four cups of wine, even [if he receives relief] from the charity plate.
מניין לארבעה כוסות רבי יוחנן בשם ר' ר' בנייה כנגד ארבע גאולות (שמות ו) לכן אמור לבני ישראל אני ה' והוצאתי אתכם וגו' ולקחתי אתכם לי לעם וגומר והוצאתי והצלתי וגאלתי ולקחתי
From where [do we know the requirement to drink] four cups? Rabbi Yochanan [said] in the name of Rav, "Rabbi Banniah said, 'Corresponding to the four [expressions of] salvations: "Therefore say unto the children of Israel, I am the Lord, and I will bring you out, etc. And I will take you to Me for a people, etc."(Exodus 20:6-7). "And I will bring you out, and I will rescue you, and I will save you, And I will take you."'
רבי יהושע בן לוי אמר כנגד ארבעה כוסות של פרעה (בראשית מ) וכוס פרעה בידי ואשחט אותם אל כוס פרעה ואתן את הכוס על כף פרעה ונתת כוס פרעה בידו וגו'.
רבי לוי אמר כנגד ארבעה מלכיות
ורבנן אמרי כנגד ד' כוסות של פורענות שהקב"ה עתיד להשקות את אומות העולם (ירמיהו כה:טו) כי כה אמר ה' אלהי ישראל אלי קח את כוס היין החימה וגו' כוס זהב בבל ביד ה' (תהילים עה) כי כוס ביד ה' (תהילים יא) ימטר על רשעים פחים אש וגפרית ורוח זלעפות מנת כוסם
Rabbi Yehoshua ben Levi said, 'Corresponding to the four cups of Pharaoh: "And the cup of Pharaoh was in my hand and I squeezed them into the cup of Pharaoh and I placed the cup onto the palm of Pharaoh... and you will place the cup of Pharaoh, etc." (Genesis 40:11-13).'
Rabbi Levi said, 'Corresponding to the four kingdoms'
and the rabbis said, 'Corresponding to the four punishments that the Holy One, blessed be He, will pour upon the nations of the world in the future: "For so said the Lord, the God of Israel to me, 'Take the cup of wine of anger, etc.'" (Jeremiah 25:15); "A golden cup is Babylonia in the hand of the Lord" (Jeremiah 51:7); "As it is a cup in the hand of the Lord" (Psalms 75:9); "Upon the wicked He will cause to rain coals; fire and brimstone and burning wind shall be the portion of their cup" (Psalms 11:6).'"
(ו) לָכֵ֞ן אֱמֹ֥ר לִבְנֵֽי־יִשְׂרָאֵל֮ אֲנִ֣י יְהֹוָה֒ וְהוֹצֵאתִ֣י אֶתְכֶ֗ם מִתַּ֙חַת֙ סִבְלֹ֣ת מִצְרַ֔יִם וְהִצַּלְתִּ֥י אֶתְכֶ֖ם מֵעֲבֹדָתָ֑ם וְגָאַלְתִּ֤י אֶתְכֶם֙ בִּזְר֣וֹעַ נְטוּיָ֔ה וּבִשְׁפָטִ֖ים גְּדֹלִֽים׃ (ז) וְלָקַחְתִּ֨י אֶתְכֶ֥ם לִי֙ לְעָ֔ם וְהָיִ֥יתִי לָכֶ֖ם לֵֽאלֹהִ֑ים וִֽידַעְתֶּ֗ם כִּ֣י אֲנִ֤י יְהֹוָה֙ אֱלֹ֣הֵיכֶ֔ם הַמּוֹצִ֣יא אֶתְכֶ֔ם מִתַּ֖חַת סִבְל֥וֹת מִצְרָֽיִם׃ (ח) וְהֵבֵאתִ֤י אֶתְכֶם֙ אֶל־הָאָ֔רֶץ אֲשֶׁ֤ר נָשָׂ֙אתִי֙ אֶת־יָדִ֔י לָתֵ֣ת אֹתָ֔הּ לְאַבְרָהָ֥ם לְיִצְחָ֖ק וּֽלְיַעֲקֹ֑ב וְנָתַתִּ֨י אֹתָ֥הּ לָכֶ֛ם מוֹרָשָׁ֖ה אֲנִ֥י יְהֹוָֽה׃
(6) Say, therefore, to the Israelite people: I am יהוה. I will free you from the labors of the Egyptians and deliver you from their bondage. I will redeem you with an outstretched arm and through extraordinary chastisements. (7) And I will take you to be My people, and I will be your God. And you shall know that I, יהוה, am your God who freed you from the labors of the Egyptians. (8) I will bring you into the land which I swore to give to Abraham, Isaac, and Jacob, and I will give it to you for a possession, I יהוה.”
Compare these three passages below - the first is from the Talmud Bavli, and the second is the the Rif's summary of the Talmud, and the third is from the Rosh's commentary on the Talmud. It seems that both the Rif and the Rosh had a version of the Talmud that required five cups of wine and not four. The Rosh addresses the issue head on as he also knew by that that others said the seder only required four cups of wine.
ת"ר רביעי גומר עליו את ההלל ואומר הלל הגדול דברי ר"ט
The Sages taught in a baraita: With regard to the fourth cup, one completes hallel over it and recites the great hallel; this is the statement of Rabbi Tarfon.
חמישי אומר עליו הלל הגדול דברי רבי טרפון...
On the fifth cup [of wine] one recites the great Hallel. This is the opinion of Rb. Tarfon....
ת"ר כוס חמישי אומרים עליו הלל הגדול דברי רבי טרפון. וי"א ה' רועי לא אחסר. ורשב"ם גורס רביעי אומרים עליו הלל הגדול דכוס חמישי מאן דכר שמיה. ואם בא לומר כוס חמישי רשות ואם ירצה יעשה כוס חמישי הכי הוה ליה למימר הרוצה לעשות כוס חמישי אומר עליו הלל הגדול. אבל לפי גירסת הספרים משמע דלר' טרפון וי"א כוס חמישי הוה ליה חובה ונהגו העולם לעשות רשות. וכן כתב ה"ר יוסף טוב עלם ז"ל שאם הוא תאב לשתות יעשה כוס חמישי. משמע מתוך דבריו שאסור לשתות אחר ארבע כוסות. ותימה דמנלן הא דלקמן לא קאמר אלא דאין מפטירין אחר הפסח אפיקומן היינו שלא לאכול אבל למשתי שרי.
Our rabbis learned, "We say the Great Hallel over a fifth cup - these are the words of Rabbi Tarfon, and there are those that say, 'The Lord is my shepard, I shall not lack' (Psalms 23)." And Rashbam [follows] the textual variant, "We say the Great Hallel on the fourth cup," as 'who mentioned the name' of the fifth cup; and if it is coming to say [that the fifth cup is optional and, if wants, he should do a fifth cup, this is how it should have said it: "One who wants to do a fifth cup should say the Great Hallel upon it." But according to the textual variant of the books, it is implied that for Rabbi Tarfon and the 'those that say,' the fifth cup is obligatory, but the world has become accustomed to make it optional. And so did Rabbi Yosef Tov Eelem, may his memory be blessed, write - that if desires to drink, he should make a fifth cup. It is implied from his words that it is [otherwise] forbidden to drink after the four cups. And it is a wonder, as from where do we have this; as later it only says, "We may not eat an afikoman (a dessert or other foods eaten after the meal) after [we are finished eating] the Pesach sacrifice" - which means not to eat, but to drink is permitted.
(י) וְאַחַר כָּךְ נוֹטֵל יָדָיו וּמְבָרֵךְ בִּרְכַּת הַמָּזוֹן עַל כּוֹס שְׁלִישִׁי וְשׁוֹתֵהוּ. וְאַחַר כָּךְ מוֹזֵג כּוֹס רְבִיעִי וְגוֹמֵר עָלָיו אֶת הַהַלֵּל. וְאוֹמֵר עָלָיו בִּרְכַּת הַשִּׁיר וְהִיא יְהַלְלוּךָ ה' כָּל מַעֲשֶׂיךָ וְכוּ'. וּמְבָרֵךְ בּוֹרֵא פְּרִי הַגָּפֶן וְאֵינוֹ טוֹעֵם אַחַר כָּךְ כְּלוּם כָּל הַלַּיְלָה חוּץ מִן הַמַּיִם. וְיֵשׁ לוֹ לִמְזֹג כּוֹס חֲמִישִׁי וְלוֹמַר עָלָיו הַלֵּל הַגָּדוֹל מֵ(תהילים קלו-א) "הוֹדוּ לַה' כִּי טוֹב" עַד (תהילים קלז-א) "עַל נַהֲרוֹת בָּבֶל". וְכוֹס זֶה אֵינוֹ חוֹבָה כְּמוֹ אַרְבָּעָה כּוֹסוֹת. וְיֵשׁ לוֹ לִגְמֹר אֶת הַהַלֵּל בְּכָל מָקוֹם שֶׁיִּרְצֶה אַף עַל פִּי שֶׁאֵינוֹ מְקוֹם סְעֵוּדָּה:
(10) And afterwards, he recites the Grace after the Meals over a third cup and drinks it. And afterwards, he mixes (pours) a fourth cup and finishes the Hallel (a set order of praises from the Psalms) over it. And he recites the blessing of song and that is "May all of your creatures praise you, etc." And he recites the blessing, "Who creates the fruit of the vine," and does not taste anything afterwards the whole night, except for water. And he should mix (pour) a fifth cup and say upon it the Great Hallel (Psalms 136), from "Give thanks to the Lord, for He is good" (Psalms 136:1) to "Upon the waters of Babylon" (Psalms 137:1). And this cup is not obligatory like the [other] four cups. And he can finish the Hallel anyplace that he desires, even though he is not in the place of the meal.
(א) אַחַר אַרְבַּע כּוֹסוֹת אֵינוֹ רַשַּׁאי לִשְׁתּוֹת יַיִן, אֶלָּא מַיִם. הַגָּה: וְכָל הַמַּשְׁקִין דִּינָן כְּיַיִן (בֵּית יוֹסֵף). וּמִי שֶׁהוּא אִיסְטְנִיס אוֹ תָּאֵב הַרְבֵּה לִשְׁתּוֹת, יָכוֹל לִשְׁתּוֹת כּוֹס חֲמִישִׁי וְיֹאמַר עָלָיו הַלֵּל הַגָּדוֹל. (מָרְדְּכַי).
(1) After the four cups, he is not allowed to drink wine, but rather water. Gloss (Ramah): And the law of all drinks (besides water) is like [the law concerning] wine (Beit Yosef). And one who is delicate or greatly desires to drink may drink a fifth cup [of wine] and say the Great Hallel upon it (Mordekhai).
