B.M.
I have 2 relatives that this happened to-
my brother did this until age 10 (I think-re age) because he was so constipated that when he got the urge he wouldn't go and then he would hold it and sometimes it couldn't be stopped.
Another -unfortunately was being abused both sexually and physically and he started having bowel issues- which is how it was brought to light. The abuser was never prosecuted because he refused to testify against a family member. He was put into therapy and is a well adjusted adult now.
Obviously- #1 is the most common and could be a likely cause for your sons...
My 9 year old won't tell me anything about his body because hes so shy about it- so I have to ask him daily about his bowels to make sure all is well.
Good luck!