You may have been suffering from haemorrhoids (commonly known as piles), which are swollen blood vessels which develop inside and/or outside the anus. If they become infected, they can cause pain and discomfort and may need treatment. When haemorrhoids do not respond to other treatments, or if they are large, or external, or they bulge, surgical removal by excision may be the best solution.
You may have been suffering from an anal fistula, which is a small channel that develops between the end of the bowel and the skin near the anus. It’s usually caused by an infection near the anus resulting in a collection of pus (abscess) in the nearby tissue. An anal fistula can also occur after surgery to drain an anal abscess.
For some haemorrhoids, surgical excision may be the best treatment, particularly if they are large, or external, or they bulge. Haemorrhoids treated in this way, rather than by non-surgical means, are less likely to return. Anal fistulas very rarely heal by themselves, so surgical excision is the only way they can be treated.