Do you have an older child who still will have an occasional or frequent bowel movement in their pants? That's frustrating for everyone. And can certainly embarrass an older child. It's important for parents to recognize that this is typically not on purpose. It is very important to speak to your child's doctor about it if this is happening. They could have something called Encopresis. https://www.webmd.com/digestive-disorders/encopresis#1. When a child has this, they are chronically constipated. They can be chronically constipated even if they have regular bowel movements. When this is the case, a child often doesn't know when they have to go because they always feel like they do. Consequently it gets harder to read the signals and they have accidents. Sometimes it also has hurt to have a bowel movement so it begins a process of 'holding'. This too can lead to accidents. Small, dark ball like bowel movements are common when a child has encopresis. Treating the constipation can help end the issue of going in their pants.
We wish you and your children all the best of health.