How is lye used in cooking?

Pretzels:

Lye plays a crucial role in creating the traditional chewy crust and characteristic dark brown color of pretzels. Before baking, the raw pretzel dough is briefly dunked in a boiling solution containing lye crystals or food-grade caustic soda. This alkali helps the starches on the surface gelatinize while creating that crust that's a must with pretzels.

Century Eggs:

Lye and other alkaline agents contribute to the distinctive flavor, color, and texture of century eggs.

Soap Making:

While not technically cooking, lye can be utilized in the kitchen indirectly through soap production. In traditional soap making, a saponification process combines lye (sodium hydroxide or potassium hydroxide) with animal fats or vegetable oils to produce soap and glycerin.