A 62-year-old woman with a history of gallstones presents with epigastric pain, nausea, and fever. Imaging reveals inflammation of the pancreas and the presence of gallstones in the common bile duct. Serum lipase is elevated. Question: What is the primary mechanism by which gallstones cause elevated serum lipase in this patient?