If you don't know exactly what happened, then that means you were riding faster than your mind could keep up. It's possible you did panic and have a simple failure to steer. That's the most common reason people go wide. It's possible you could have saved it.
This is not a criticism. I have crashed because I was riding above my ability. I wasn't hurt except for a sprained thumb, which still aches years later when it gets fatigued—a good reminder for me. But I did slide head-first past a big rock. If I had hit that, I think I would have been crippled or dead.
That crash was a really good lesson for me. Now I try to be 100% calm when riding, and as smooth as possible. Even when leaned over on the edge of the tire in a corner, I must be completely calm and aware of what is happening. If I am not calm, or if I am scared, then that means I'm riding above my ability, and technically I am out of control, and I need to dial it back.
The interesting thing is, riding with that mentality now, I am a better, faster, smoother—and safer—rider than I was before.
So this crash could be a good lesson for you. It could make you a better and safer rider. It's always good when you can learn a lesson relatively cheaply.