My son was on the late side of potty training. Then he was not dry through the night until about age 7. But he would still have accidents often, it seemed. Or, partial accidents.
I noticed that when he was sick he had less accidents. I started to realize that perhaps it was because he was taking a lot of vitamin c. Maybe the accidents were related to having a low grade UTI.
I started to give him a supplement each day that had D-mannose, vitamin C and cranberry in it.
His little accidents have stopped.
So my suggestion is to check for a UTI for children who struggle with accidents past when they should have stopped.
For the record, dairy in the evenings would pretty much guarantee an accident for him at night. I still avoid dairy after dinner.