Laura Well, because here we have some special history. I will probalby be a subthread but if you want I can tell you something about how one of the most powerful nations in the world of the past got part of Germany.
Bavarians are no Germans, we habe been an independet country before. We have owned northern Italy, Austria and what still is Bavaria today, as well as the Palatinate - so the biggest part of South Germany. That's why you still speak Bavarian in the autonomous region of South Tyrol (formally part of Italy) and in Austria. And why we habe the same culture there.
The borders habe moved a lot in hirstory, and as the Bavarian Army defeated the turkish eho were fallen in their country till Ebersberg (a town close to Munich, the capital of Bavaria, we pushed them back with united forces of all of pur troops - back to their own country and did even free neighbors and all the other countries they tried to conquer, lile for example Romania. They were said to be very cruel, did make roads using the heady of the citicens of the fallen countries to build a road, just for fum. After that, as the Turkish have also been one of the strongest nations that time, the bavarian army was weakened. The Emperor used that occasions and conquered Bavaria and took our King prisoner. As the Bavarian citizens came to unite and tried to free our King the guards did kill every citizen who of course had no weapons apart from knifes and pitchforks - It's said that even though it was a free field, where the liberation attempt happened, you could stand in the blood of the fallen citicens till your ankles.
That massacre happened at christmas eve because the Bavarians are very religious, so they thought the guusrdians wouldn't expect an offense that evening.
Since then Bavaria has been part of Germany (as well, as since sfter that a following bavarian king has sold governmental rights to the Prussians but I'm not going to mentions that here because of my patriotism lol )
That's how I know the story
https://en.m.wikipedia.org/wiki/Sendling%27s_night_of_murder
They decided to rather die then lice in an occupied Bavaria.
Now, how did Austria get independent from Bavaria?
As the Habsburger (Family) who have bern the lords of a region in Franconia (northern part of Bavaria) wanted to get independent from the Bavarian King he had them moved to the south east of the Bavarian Kindom for punishment - but they managed to reach independence there.
And as the italiens managed to conquer ground, they did even manage to occupy south tyrol - but they never have been able to fully occupy it - it still ks an independent region.
So today we have the free state of Bavaria, the Republic of Austria and the Independent Region of South Tyrol. In South Tyrol and the Free State of Bavaria there still are parties who try to make thme independent. Many members of that parties also fight to reunite the three Bavarian Countries.
And this is the reason why a German won't understand a Bavarian when both speak their first language.