Answer
The digestive system is protected from gastric secretions in two ways: where the system has an acidic lumen, the mucosal lining prevents auto-digestion, and elsewhere the pH of the chyme is neutralized to further prevent self-digestion,
Work Step by Step
Think of a plastic bag containing acid. It could be destroyed by acid, so it needs a coating on the inside which resists the action of acid. In the same way, you could add baking soda to neutralize the contents of the bag before dumping it onto the ground where the acid could cause damage.