It is stated in Berakhot (59b): For a change of wine one does not need to recite a blessing [...]. But one says "Blessed is He Who is good and does good." And Rashi explained: If one drank wine during a meal, and they brought him another wine better than the first – he does not need to recite the blessing "Who creates the fruit of the vine." Thus far his words. And it is clear from his words that the blessing of "the Good and He Who does good" is only over wine better than this one. And similarly wrote the Rambam in the fourth chapter, law 9, and this is his wording: If they were reclining to drink wine, and another type of wine came to them, such as if they were drinking red and they brought black, or old and they brought new – they do not need to recite the blessing of the wine a second time. But they recite: "Blessed are You, Hashem, our God, King of the universe, Who is good and does good." Thus far his words. And certainly the Rambam would agree with Rashi that another wine that is better is no less than another type. And also Rashi would agree with the Rambam, obviously. And so it is explained in the Yerushalmi at the end of the sixth chapter of Berakhot: Old wine, new wine – one must recite a blessing. A change of wine – one does not need to recite a blessing... Rabbi, over every single barrel that he would open, he would recite a blessing over it. And what would he say? "Blessed is He Who is good and does good...". Thus far his words. And the barrels were different from one another, either better than the previous one according to the explanation of Rashi, or another type according to the explanation of the Rambam. And the matter of this blessing: for even though regarding all types of foods, and all types of drinks, there is one blessing for all the particulars within that type – even for those more excellent than the previous ones, such as one who recites a blessing over a type of food and they brought before him two types, and he recited the blessing over the inferior one, he exempts even the one better than it, or if this one is white and this one is black – in any case he exempts. Yet only regarding wine did they institute this because of its importance, for because of this they established for it a specific blessing. And even though bread is also so, nevertheless wine gladdens the heart of man, and one only recites song over wine. Furthermore: in Yavne they instituted "the Good and He Who does good" in the Grace After Meals because of the slain of Beitar (Berakhot 48b), and it is stated in Gittin (57a) that they harvested their vineyards for seven years from the blood of the slain. Therefore they instituted this blessing also over a change of wine (beginning of the ninth chapter, siman 15). And the meaning of "the Good and He Who does good" regarding a change of wine is not like "the Good and He Who does good" that is in the Grace After Meals: "the Good" – that they did not decompose, "and He Who does good" – that they were given over for burial. For what is its relevance here? Rather its meaning is like "the Good and He Who does good" when one's wife gave birth to a male, and similar cases that will be explained in siman 223, whose meaning is that the Holy One, Blessed be He, is good and does good to His creatures. And in the Grace After Meals they instituted such a thing regarding the slain of Beitar, meaning: that even at the time of the dominance of the strong judgment as with the slain of Beitar, nevertheless He, may He be blessed, is good and does good in the matter of the retribution as well, and that is that they did not decompose and were given over for burial. But here its meaning is simple, as I have written.
איתא בברכות (נט ב): שינוי יין אין צריך לברך […]. אבל אומר "ברוך הטוב והמטיב". ופירש רש"י: שתה יין בסעודה, והביאו לו יין אחר טוב מן הראשון – אין צריך לברך "בורא פרי הגפן". עד כאן לשונו. ומבואר מדבריו דברכת "הטוב והמטיב" אינו אלא על יין טוב מזה. וכעין זה כתב הרמב"ם בפרק רביעי דין ט, וזה לשונו: היו מסובין לשתות יין, ובא להן מין יין אחר, כגון שהיו שותין אדום והביאו שחור, או ישן והביאו חדש – אינם צריכים לברך ברכת היין פעם שנייה. אבל מברכין: "ברוך אתה ה', אלהינו מלך העולם, הטוב והמטיב." עד כאן לשונו. ובוודאי יודה הרמב"ם לרש"י דיין אחר טוב לא גרע ממין אחר. וגם רש"י יודה להרמב"ם כמובן. וכן מבואר בירושלמי דסוף פרק ששי דברכות: יין ישן, יין חדש – צריך לברך. שינוי יין – אין צריך לברך… רבי על כל חבית וחבית שהיה פותח, היה מברך עליה. ומה היה אומר? "ברוך הטוב והמטיב…". עד כאן לשונו. והחביתין היו משונים זה מזה, או טוב יותר מהקודם כפירוש רש"י, או מין אחר כפירוש הרמב"ם. ועניין ברכה זו: דאף על גב דבכל המיני מאכלים, ובכל המיני משקין, ברכה אחת לכל הפרטים שבאותו המין – אף להמשובחים מן הקודמות, כגון המברך על מין מאכל והביאו לפניו שני מינים, ובירך על האחד הגרוע פוטר גם את הטוב ממנו, או שזה לבן וזה שחור – מכל מקום פוטר. ורק ביין תיקנו כן מפני חשיבותו, שמפני זה קבעו עליו ברכה פרטית. ואף על גב דגם פת כן הוא, מכל מקום היין ישמח לבב אנוש, ואין אומרים שירה אלא על היין. ועוד: דביבנה תיקנו "הטוב והמטיב" לברכת המזון משום הרוגי ביתר (ברכות מח ב), ואיתא בגיטין (נז א) שבצרו כרמיהם שבע שנים מדמי ההרוגים. ולכן תיקנו גם על שינוי יין ברכה זו (ראש פרק תשיעי סימן ט"ו). ופירושו של "הטוב והמטיב" בשינוי יין אינו כ"הטוב והמטיב" שבברכת המזון: "הטוב" – שלא הסריחו, "והמטיב" – שניתנו לקבורה. דמה עניינו לכאן? אלא פירושו כ"הטוב והמטיב" בילדה אשתו זכר, וכיוצא בזה שיתבארו בסימן רכ"ג, שפירושו שהקדוש ברוך הוא טוב ומטיב לברואיו. ובברכת המזון תיקנו כזה על הרוגי ביתר, כלומר: שאפילו בעת שליטת הדין החָזָק כמו בהרוגי ביתר, מכל מקום הוא יתברך טוב ומטיב בעניין הפורעניות גם כן, והיינו מה שלא הסריחו וניתנו לקבורה. אבל בכאן פירושו פשוט כמו שכתבתי.