PARENTING ADVICE—possible trigger*

So, not me but someone I know, has a 12-year-old daughter whom (the mother has recently told me) still wets her pants at school and even at home during the day. She said the girl was 100% potty trained from age 3-5(6) and then all of a sudden, the child stopped using the restroom to pee during the day and its been going on ever since. She still stays dry at night, but my friend is becoming increasingly concerned as her daughter approaches middle school.

She’s tried talking to her, she’s been in therapy for years, nothing seems to be helping.

I may get judged for this but can’t help but feel that there’s something kinda serious behind this kind of developmental regression but I don’t want to be condescending or, at worst, accusatory... I obviously know it’s none of my “business”, I just wish I had more information to try and help my friend.

I was curious about advice from other parents or even professionals about this sort of thing? Child is completely average intellectually, developmentally, socially, etc. it’s just this one specific thing.