A lot of people don't know this because Bavarian is often called a German dialect so people have this idea of it being a variant of Standard High German, but they're actually different subbranches of the same branch, even though collectively, all West Germanic varieties that are not Low German or Dutch are grouped together as High German:
Standard High German is located in High German > Upper German > Middle-Modern High German > Modern High German > Upper Franconian;
Bavarian varieties are located in High German > Upper German > Middle-Modern High German > Modern High German:
(source)
(Bairisch = Bavarian, and Hannover German is considered the 'purest' form of spoken High German, so you can see that they're not mother and daughter but more like siblings.)
Bonus 1:
(source)
Relatedly, peole often think of the trichotomy being German Standard High German, Austrian German, and Swiss German, whereas from a linguistic pov it's actually Alemannic, Bavarian, and Upper Franconian* (the latter is not to be conflated with the subgroup of the Franconian dialects spoken in Bavaria that is colloquially called Oberfränkisch/Upper Franconian, which is part of the Greater East Franconian subgroup. which also contains Western Yiddish. confused yet?)
(source)
This map can be found here as an interactive map where you can zoom in for better legibility. Essentially, in the terms I used above:
yellow-green-teal: Upper Franconian varieties
red-orange-pink: Alemannic varieties
turquoise-blue-purple: Bavarian varieties
So you can see that they dont separate neatly at country borders, but, as is often the case, have large transition areas.
This is a historic map so it includes the historical varieties of Silesian (not to be confused with the West Slavic language of the same name) and High Prussian.
*Bonus 2:
As shown above, there's also low german of course, but that is in a completely different branch called North Sea Germanic which is a direct subbranch of West Germanic:
(source)












