This ancient standard for beer ingredients has both ensured the quality of German beers and arguably stifled innovation, leading to a small range of beer styles available. Under the standard only water, malted barley and hops were allowed to be used in making beer. Yeast and its action wasn't dicovered until much later and so wasn't included.
Originally a Bavarian law from 1516 that was made national as part of the conditions for joining the German Empire in 1871. In 1987 the European Courts of Justice declared that the standard was an unfair barrier to incoming trade and it was dropped. Most German brewers still voluntarily stick to the standard though as the Germans are a decerning bunch when it comes to their lager.
Some exceptions were made to this rule, most notably wheat beers. These were allowed to be brewed and drunk by some royalty, but the style expanded until it was commonplace in the 20th cetury.