score:17
Bavaria joined Prussia after the Franco-Prussian War.
Prussia had emerged as the state that could defend "German" interests by leading the Germans in the defeat of France. Earlier, Prussia had beaten Austria in the Seven Weeks War of 1866.
Austria had to settle accounts with Hungary after the 1866 war (after having quashed that country's bid for independence in 1848). So in 1867, she elevated Hungary to a "dual" Austro-Hungarian monarchy, allowing Hungary to administer about half the combined empire. In so "partnering" with a non-Germanic country (as opposed to say, Bavaria, and letting the Hungarians go their way), Austria signaled that German affairs were of secondary importance to her. That signal was further reinforced when Austria declined to join the Germans (or France for that matter) in the Franco-Prussian War.
Under the circumstances, Prussia appeared to be the "coming" German power. With Austria no longer a viable alternative, it was a case of "let's jump on the bandwagon before it's too late."