No way to tell now, since reformatting removes any evidence at to what was wrong, or how keep it from happening again - my guess is when you lost power suddenly, the hard drive boot sector became corrupt. I suspect you could have done a
XP Repair Install instead of a format and reinstall, but no harm done, assuming you had your data backed up, and you have now fully updated your system, and setup a good security defense.
Was the battery installed and charged? I would wonder why the battery did not keep the notebook running. How did the plug come out? They don't normally just fall out. Was it yanked out?