Welcome to Android Central! I've seen other posts about this happening, although it's pretty rare. In order for the tablet to do a spontaneous factory reset, I would suspect some catastrophic glitch in the firmware. It's not a good sign. You've already lost the locally stored data--hopefully you were already in the habit of syncing or backing up all of your important data. I would be cautious in the future. If the tablet is still under warranty, it may be worth contacting Samsung about this.