In 1817, when Grand Duke Karl of Baden lost his only son, the next person in line was his uncle Ludwig, who was childless. Under the laws in place in Baden, the Queen of Bavaria was next in line after Ludwig.
What if Bavaria inherited Baden at some point between 1817 and 1830 (when Ludwig historically died).
Bavaria and Wurttemberg were pretty much in lockstep politically up until German Unification. Between the three south German states, that's 19.74% of German Confederation Military expenditures in 1830 (versus 31.44% for Austria and 26.52% for Prussia), so it'd be quite the third force in German politics.
The Baden Constitution of 1818 was fairly liberal, allowing 70% of male subjects to vote. The Bavarian Lower House was elected by 6% of the population. Bavaria was ruled by Ludwig, who following the Belgian and French (July) Revolutions became a reactionary. Political chaos likely ensues depending on when Bavaria absorbs Baden. Plus Palatinate was fairly liberal historically (I think) so now Bavaria has a lot more liberals to deal with.