Pretzels and bagels have a particular mouthfeel because of their two distinctly different textures: their outsides are thin, hard shells and their insides are soft.
Pretzels, which have a distinctive salty taste, are made from a stiff wheat flour dough. Once they have been shaped, they are sprayed very quickly in an alkaline solution of water and lye (sodium hydroxide). The lye combines with the carbon dioxide in the air and form a hard calcium carbonate shell, a process known as calcification. The heat and moisture present in the oven cause the starch on the surface of the pretzels to gelatinize. When baked at a high temperature, this gelatinized exterior becomes hard and shiny. Because the lye is alkaline, it helps speed up the Maillard reactions on the crust, turning it brown and enhancing its taste. The oven temperature is then lowered while the pretzels continue to bake until the insides are completely dry but still riddled with tiny air bubbles. Calcification of the outside shell can also be induced by gentler means, by substituting baking soda for lye.