Surgical intervention is important for treating gastroesophageal reflux disease (GERD) when symptoms do not significantly improve with medication or when there are serious issues in the esophagus, such as bleeding, esophageal narrowing, or the presence of esophageal ulcers, among other complications.