Approximately two thousand years ago, central Europe was the home of the Germanic tribes. The Roman expansion in Europe never succeeded in establishing a permanent foothold in the area north of the Danube and east of the Rhine, leaving this region as one of the few truly independent cultural centers of Europe.
These Germanic tribes - they were not Germans, though some of them would later be - gave us many cultural treasures, including literary masterpieces like the Icelandic Sagas, or the Nibelungen; they also gave us the basis of the English language. English, as students of Beowulf know, is derived largely from Germanic dialects like Saxon and Frisian, and only a few English vocabulary items came from Latin.
These founders of what would later become several nations - Norway, Sweden, Denmark, Netherlands, Germany, Prussia, Austria, Flanders, Iceland, and kingdoms like Saxony, Bavaria, Hessen, etc. - were innovators and experimenters. One interesting practice which they began was the boiling of a solution of lye and water. Lye is a caustic and dangerous chemical, sodium hydroxide, NaOH. This boiling mixture is toxic if consumed, and causes chemical burns on human skin. But into this liquid, they tossed lumps of bread dough. Scooping them out of vat, these lumps were then baked, often with salt. The lye was rendered non-toxic by the baking and by reacting with the bread dough, but it left a distinctive and pleasurable taste, and a glossy brown surface.
A few centuries later, the Germanic tribes would be exposed to the belief systems of Christianity and Judaism. This caused them to give up their habit of sacrificing humans on stone altars to the Germanic pagan divinities. But they didn't give up their lye.
Those Germanic tribes who converted to Christianity began to form their bread dough into the distinctive shape we now know as a "pretzel"; the Jews who settled in the area learned the practice from their Germanic neighbors, but opted for a simpler, circular shape - a bagel, from the Germanic word meaning "circle".