It sounds like you did an SMC reset without knowing it.
To do an SMC reset you pull the power cord out then hold the power button for about 5 seconds then release the power button. Reconnect the cable and power the iMac up normally.
Basically that kills all power in the power supply by discharging the capacitors, something in the hardware is reset and allows the computer to power up.
Leaving the computer unplugged for 30 minutes or so would basically achieve the same thing.
If you don't have any further problems then I would not worry about it. If your iMac is not on a UPS, I highly recommend that you get one. They are very cheap insurance...