Mayo Clinic defines encopresis here:
Encopresis occurs when your child resists having bowel movements, causing impacted stool to collect in the colon and rectum. When your child's colon is full of impacted stool, liquid stool can leak around the impacted stool and out of the anus, staining your child's underwear. Encopresis may also be called stool holding.
Encopresis usually occurs after age 4, when your child has already learned to use a toilet. In most cases, encopresis is a symptom of chronic constipation. Less frequently, it may be the result of developmental or emotional issues.
Encopresis can be frustrating for you — and embarrassing for your child. However, with patience and positive reinforcement, treatment for encopresis is usually successful.