Germany was a monarchy until the German Empire lost the First World War and its political system collapsed. Within a mere 18 days (7th ‒ 25th November 1918), all German monarchs abdicated. The first one was Ludwig III of Bavaria, whose family ‒ the House of Wittelsbach ‒ had ruled the state for 738 years.
The leftists that had organised the revolution against the Wittelsbachs took power and declared Bavaria a republic. However, they couldn’t decide whether they should have a democracy based on general elections or on councils (which are called “soviets” in Russian). Initially, it looked like the first and there were elections. But then, the more radical leftists proclaimed Bavaria a Soviet republic on 7th April 1919 and established a Red Army to protect it.
The elected government fled Munich and schemed to topple the Soviet regime, whose powers never extended much beyond Munich. Once the elected government had banned imports to Munich, the Soviet side started lacking food, fuel, etc. and became eager to talk to the others. But the government didn’t want to talk, it mobilised its troops and right-wing volunteers (the “Freikorps”).
These troops invaded Munich on 1st May 1919, killed over 300 civilians because they were mistaken for communists, and defeated the Red Army within two days. The last fights ended after a week. Over 1,000 communists were put on trial, with some being executed. The elected government was nominally back in power. In reality, the power had shifted to the right. With many leaders of the Soviet regime being Jewish, anti-Semitism was on the rise. A liberal city with lots of artists before the war, Munich became the centre of the political right and the birthplace of the Nazi party in 1920.