The defeat of the German army in World War I led to a complete change in the country's system of government.
Before and during the war, Germany was a monarchy. It did have a legislature and some amount of democracy, but it also had a monarch who actually ruled the country instead of being a figurehead. This ended when the war ended. As the war came to an end, German people, both civilians and military, began to rebel. The Kaiser and other royals soon abdicated their positions and a republic was created.