Hernia surgery is an operation performed by doctors to fix a problem in your body called a hernia. A hernia occurs when an organ or tissue pushes through a weak spot in your muscles or connective tissues. The surgery aims to repair or close this weak spot and put the organ or tissue back in its proper place.