Cause of this secret are tight junctions and mucous.
As Wikipedia explains:
Tight junctions, or zonula occludens, are the closely associated areas of two cells whose membranes join together forming a virtually impermeable barrier to fluid. It is a type of junctional complex present only in vertebrates. The corresponding junctions that occur in invertebrates are septate junctions.
They perform vital functions:They hold cells together.Barrier function, which can be further subdivided into protective barriers and functional barriers serving purposes such as material transport and maintenance of osmotic balance:They help to maintain the polarity of cells by preventing the lateral diffusion of integral membrane proteins between the apical and lateral/basal surfaces, allowing the specialized functions of each surface (for example receptor-mediated endocytosis at the apical surface and exocytosis at the basolateral surface) to be preserved. This aims to preserve the transcellular transport.They prevent the passage of molecules and ions through the space between cells. So materials must actually enter the cells (by diffusion or active transport) in order to pass through the tissue. This pathway provides control over what substances are allowed through. (Tight junctions play this role in maintaining the blood–brain barrier.) At the present time, it is still unclear whether the control is active or passive and how these pathways are formed. In one study for paracellular transport across the tight junction in kidney proximal tubule, a dual pathway model is proposed: large slit breaks formed by infrequent discontinuities in the TJ complex and numerous small circular pores.1In human physiology there are two main types of epithelia using distinct types of barrier mechanism. Dermal structures such as skin form a barrier from many layers of keratinised squamous cells. Internal epithelia on the other hand more often rely on tight cells junctions for their barrier function. This kind of barriers is mostly formed by only one or two layers of cells. Until recently it was not clear whether tight cell junctions also play any role in the barrier function of the skin and similar external epithelia, recent research suggests that this is indeed the case.
In the next step mucous protect epithelial cells from released HCl.
Here you will find more things.