Sweetie, even if it was just a genuine accident, it probably happens more than most of us would like to admit, even at your age. There's nothing to be ashamed of.
I admit I've had dreams that were so real of myself waking up, walking to the restroom, and going ... and just barely waking to realize I was actually in bed and starting to wet it. I'm also horribly sleep deprived because of a sleep disorder, and I absolutely blame the sleep deprivation. There comes a point in sleep deprivation that your muscles will just up and quit out of exhaustion, and I think that's sometimes what may happen with a rare bed wetting incident. Or like I've had, such a realistic dream of getting up and going that you don't realize you're still asleep.
Also, when someone has good quality sleep, normally the "urge to go" is shut off by the brain, and most people won't have to go until they wake in the morning. If you are not getting to deep levels of sleep, that urge is not shut off. I never get to deep sleep because of my sleep disorder, so I get the urge to go many times in the night and have to get out of bed and walk to the restroom.
Also consider if you drank anything after 8 p.m. That may have overburdened your bladder.
The time to worry is if it is a regular, repeating situation and you don't notice anything that might be contributing (sleep deprivation, bad dreams, emotional upset, signs of infection) ... that's when you may need to see a doctor because of incontinence.