The Russian word for German is немецкий which means something like, "voiceless" or "mute." And yet the country is sometimes referred to as Германия. Why the difference between the two?
In the Russian language world view, there is a significant difference between one's citizenship (гражданство, referring to the country) and ethnicity (национальность). For example, Russian may mean either российский or русский. A person may be referred to as россиянин (a citizen of Russia) and as русский (ethnic Russian), being, for example, ethnic Tatar.
So, some countries have a pair of adjectives, one referring to the country itself, and the other to the ethnicity. Returning to the question, германский is the former and немецкий is the latter:
Германский refers to the country or the territory: германский флаг, советско-германский пакт о ненападении, германские племена (tribes that lived on the territory of modern Germany).
Немецкий refers to the language, ethnicity, or culture: немецкий язык, немец (ethnicity), немецкая литература.
Германские языки is a slightly complex example: German (немецкий язык) is one of the Germanic languages (германские языки). Германские языки here is a number of languages originally spoken on roughly the territory of modern Germany, as well as the languages descended from those. English, as a matter of the fact, is considered a Germanic language (Английский язык относится к германской языковой группе). Here, немецкий и германский are obviously non-interchangeable.
The difference is historical and basically stems from the Russian word mute ("немой") as a person not speaking the Russian language. According to the Wikipedia Article on Немецкая Слобода
Немцами тогда называли не только уроженцев Германии, но и вообще любых иностранцев, не знавших русского языка («немых»).
The basic issue is that most of the permanent settlers were primarily from the German kingdoms that were hired for various purposes starting in XV-XVI centuries according to a Wiki article on Germans in Russia.