Loosing at 97% is even more annoying when you have seen the source code and know how rigged the combat odds are I changed it in my mod so that combat odds below 5% / above 95% are 0% / 100%. If you attack at 0% you will never will, but still do damage to enemy unit. and if you attack at 100% you will always win, but might take damage. My guess is that they made combat random in CIV4 to reduce snowball effects and create some kind of artificial challenge since the tactical AI is rather poor. For example in CIV5 combat is a lot more deterministic and that allows much more to abuse tactical AI.