Have you tried talking with her about it?
Not in a way that will make her feel self-conscious... but in a light way that will perhaps coax her to say why?
Stress, can also affect kids and it can create 'regression' or accidents.
Then there are age related pee accidents. They at this age "think" they can hold it longer, but they cannot.
That happened to my daughter AT that age too.
But she did not have poop accidents.
But, my Daughter's Preschool Teacher and Kinder Teacher AND 1st Grade teachers, ALL said, that kids these ages do have accidents. Thus, the parent is asked to bring in extra clothing for their child to keep at school.
Is your daughter, stressed about anything?
Any changes in her life?
Any problems you don't know about?
How is Daycare for her?
Or, she could have a medical problem. For example: there is something called "Encopresis" (look it up online), in which a person has leaking of poop. It is INvoluntary.
Or, urinary infections, can cause incontinence too.
So, perhaps think about that too, or take her to the Doctor, to rule out infections.
But, talk with your daughter. Not scolding her or making her feel weird about it.
Per her age she may not be able to be articulate about it.
But just see what she says.
But also, NO kid is 100% perfect about toileting and they DO have accidents... no matter what age. Even older kids have accidents. Too.
And for night time... complete dryness at night is not something that is Biologically attained, until even 7 years old. And this is normal. Kids do still wear diapers at night, at this age. My daughter did until she was already 5 years old.