We (the players) don't know, but Disney developer may have a formula and they are not likely to share that information.
DS is right that you don't always get compensated for it. Long time ago, I reported a case when I attacked a base, got 3 stars (happened to have a screenshot for it as I was preparing to share with my squad), got tons of loots, medals and gears but then an error popped up at the end and I lost everything. I got 0 compensation, even though this was clearly Disney fault (app crashed). Gave up on reporting those, lol
When it's Disney's fault that you lost your base, you can request compensation and you should get it. Like when they shut down Windows, or when their database was corrupted causing many players to lose their base. These are the known cases that Disney compensated by giving players lots of crystals to rebuild the base BECAUSE IT WAS THEIR FAULT.
In this case, someone else hacked into the OP's Facebook account and stole his/her base. This is internet crime and is not a direct fault by Disney. (You can hire a lawyer and argue that perhaps Disney shouldn't have used Facebook to store the secret key, but that is a bit of a stretch. It's like your house gets destroyed by the storm and you sued the government for allowing you to live in a place where there could have been a storm, or allowing a builder that did not build house strong enough to survive a storm.) If anything, Facebook should be the one to compensate for the player's lost and not Disney. But good luck with that.
I thought it was a good gesture for Disney to give crystals for this player to rebuild the base.