Not too sure why an iMac system would start on its own - when it's not suppose to.... Perhaps it's an inner ghost thing. 😕
Seriously... Could be from a wild UPS handshake (restart) signal, could be from a wild network handshake (restart) signal, or perhaps an inner schedule / timer thing. Not too sure why.... Hopefully, its only a "1 of" situation and doesn't happen again....
If your iMac is running SL, simply go into its System Preferences - Security - General panel and ensure a check mark is placed within "disable automatic login" box. If your iMac wants to automatically restart again (especially when you aren't near it), it cannot auto login all the way. Good security setting - until the background auto-restart reason is found...
Hope this helps...