The primary function of Brunner's glands is to secrete an alkaline mucus that neutralizes the acidic chyme coming from the stomach. This mucus provides a protective barrier for the duodenal epithelium against the harsh acidic environment and digestive enzymes. Additionally, the mucus contains bicarbonate ions which further aid in neutralizing stomach acid.