It is certainly not a willful behaviour at this age, especially in the middle of the night. So it won't help to explain your expectations, it will just frustrate her more.
Was there any substantial change lately in the child's life? E.g. birth of younger sibling, starting kindergarten / preschool, problems in kindergarten / preschool, mom / dad starting / changing job, moving to a new apartment, illness or death in the family...
Wetting the bed after having been stably dry for months can be the symptom of some sort of regression due to an internal crisis / trauma, caused by some event like the above. Or it can be the result of a plain physical condition, like a urinary infection.
To prove or close out the latter, you need to take her pee to a lab for a urine test. If it is positive, you will get antibiotics to cure the infection. The cure may take a couple of weeks, but after that hopefully the problem gets solved.
If there is some internal crisis in the background, you need to be patient, discuss the issue with the child and spend extra personal time with her if she requires it. If she feels safe and loved, she will usually process things in a couple of weeks and then keep her bed dry again. However, if the condition prevails longer, you may want to seek help from a child psychologist or doctor.