My daughter did that too, at 3-4 years old, when she started preschool, and she seemed to do it, as she said, simply because she "forgot" as she was playing and by the time she went to the bathroom it was too late. She is almost 5 yrs. old now... but SOMETIMES in a blue moon, she'll wet her pants too....but it was at times when school was going to end, and she was then going to start Kindergarten. It was anxiety and perhaps "stress" at the new stage in her life, and the changes to occur. She would tell us though. Sometimes though, it's just the adjustment to their lives... and their new environment, and they may be shy about it and going to the bathroom in a different venue so to speak. One thing though, I knew it was a temporary thing with my daughter, she didn't like "attention" about it and was a little embarrassed... i would just reassure if that I am there for her if anything is bothering her, and we won't judge her. We never reprimanded her for her "accidents" though. You could ask the teacher to "remind" your daughter about going to the bathroom perhaps?? But you may also want to see if there is something else wrong... that is causing her stress or what not, which can usually trigger these episodes. Good luck
~susan
www.cafepress.com/littlegoogoo