I think that you could both both be a little nicer. I think that the OP is lucky to get second answer given his reply, but ...
The answer to the OP's question is that no one can answer the question as to why it has happened due to lack of psychic powers. That is to say: we don't know what you know. For example you don't give ANY information about the PC including what it is nor how old it is. However here is a list of possible causes: bad battery, old battery, badly used battery, bad PSU cooking the battery, bad luck, etc.
The fix is to replace it. There is no way of predicting whether it will happen again: next day, next week, next year.
T, December 2010