By default, XP operates an automatic restart in the event of a system failure. Therefore, more or less anything cocking-up the operating system during the shutdown process could account for this reboot.
I would first suggest turning OFF auto-restart ...
Right-click on
My Computer, click
Properties, click the
Advanced tab.
Under
Startup & Recovery, click
Settings.
Under System Failure,
uncheck the box in front of Automatically restart.
Now, with a bit of luck, you should get a BSOD ...
Please post the error in full, if you do get one.
There is a whole host of hardware/software that has contributed to the 'infamous' Shutdown problem.
Try
This Site for some good pointers.