Surgery is not always necessary but may be recommended in certain cases where other treatments have failed. For example, laparoscopic surgery may be used to remove endometrial tissue in endometriosis or fibroids in the case of uterine fibroids. The decision for surgery is made based on the severity of the condition and the patient's symptoms.