You should see all the variables in the code for how magic bolt works. I think for the most part it is accurate to what you would expect BUT it also varies based on conditions.
If your buff damage is too low, it will fail. If you are fighting a Dark Lord it will fail. There is a 5% chance that if you are in IT Combat it will fail.
It also increases its effectiveness based on your spell level, or how weak of a monster you are fighting.
If you are fighting the Tarrasque it gets resisted every once in a while. Sometimes you also get more effectiveness based on how good you are.