A brief history of the German language
The German language is widely spoken in Europe, with 95 million native speakers mainly in Central Europe, and 10 to 15 million speak it as a second language. It is the official language and majority language of Germany, Austria, Switzerland, Lichtenstein, and South Tyrol, a bilingual and bicultural region in northeast Italy (it is also spoken in Luxembourg and Belgium but not as a majority language.)
The German language is one of the most spoken languages in the world, placing itself at the 12 positions after English, Mandarin, Hindi, Spanish, French, Arabic, Bengali, Russian, Portuguese, Indonesian, and Urdu.* Some of these countries have a higher population of native speakers while a reason for the major diffusion of some languages in different parts of the world was the practice of colonialism (think about South America). It is also the second most widely used scientific language, as so many scientific researches are documented in German.
It is part of the West Germanic Language Family (Dutch, Afrikaans, English) part of the wider Germanic Language Family. Furthermore, it developed from Proto-Germanic (500 BCE) and spread due to migration from Scandinavia, developing different varieties (Eastern, Western and Northern dialects).
The today German language originated from the Western dialects after it split into two distinct groups: High German (Hochdeutsch) and Low German (Plattdeutsch). The differentiation into high and low is not related to status but geography. The Hochdeutsch originated in the south areas of Germany, which are a higher elevation, while Plattdeutsch originated in the north areas characterized by lower elevation.
Through the years, many dialects developed, reaching a point where a person from the south could not understand a speaker from the north and vice versa. Until Standard German, also called Hochdeutsch(do not get confused with High German), came into the picture as writers developed, over a few centuries, a language understandable by the majority of speakers of different dialects.
The most relevant factor for the standardization of the German language was the translation of the Bible into German by Martin Luther in 1522. It was based on the Saxon dialect in central Germany, including some vocabulary from other different dialects. All around Germany, people owned and studied the bible, resulting in the diffusion of Standard German. As there was no single way of pronouncing this new form of German, the Hanover dialect became the standard for pronunciation.
To conclude, Standard German began as a written language, but it became more and more common as a spoken language as it was employed in education. Virtually every German can speak Hochdeutsch, and casually its local dialect. There is not only one standard variety, as Switzerland and Austria have their own, with some differences in vocabulary.
Sources:
Langfocus: The German Language. https://www.youtube.com/watch?v=K3IImGiiY1Q
*https://blog.lingoda.com/en/most-spoken-languages-in-the-world-in-2020/