Why is caustic soda (NaOH) used to clean beer bottles?
Caustics such as $\ce{NaOH}$ and $\ce{KOH}$ are effective in converting insoluble fatty acids in organic fats and oils into soluble soaps in a proccess called saponification. The caustics also react with cell membranes, DNA and RNA, destroying undesired yeasts, bacteria and other microorganisms. 

That said, caustics react with the glass itself, removing the surface and etching the glass. Use will weaken and damage containers. 

Use caution! Caustics also destroy skin and clothing, and are particularly damaging to the eye.