Just inside the anus are a number of small glands that make mucus. Occasionally, these glands get clogged and can become infected. This leads to a painful condition in which a collection of pus develops near the anus. This pus collection is called as anal abscess. About half of these abscesses may develop into a fistula.
See the animated YouTube video ( time slab between 0 sec to 1.10 min ) =>
90% of all ano-rectal abscesses are caused by non-specific obstruction and subsequent infection of the glandular crypts of the rectum or anus.