Hernia surgery, also known as inguinal hernia repair, is done for the treatment of pain and bulges in the inguinal canal.