iMac shut down due to power outage; started working after a few hours I am using an iMac which got shutdown due to sudden power cut. Once the power came back it wasn't starting up.  However, when I tried again after few hours it started.
Can anyone please tell me what actually happening at hardware level due the power suddenly being gone and how it started working after a period of time doing an NVRAM or SMC reset or without doing anything?
Once power came it is not starting but when I tried after few hours it started.

Switching power supplies have a re-settable fuse that will trip if there is a power surge and reset itself after some time or if you remove the power cord and hold the power button to dissipate any remaining charge in the circuits.  So, the symptoms you describe are very much in line with how these circuits work.  They cut off current for a period of time and then reset themselves so your power supply works again.
When you have a power outage, it is very common for the power to come back with a power surge (also known as a voltage spike).  This fuse is built into the power supply to protect it from surges like this.
That said, I wouldn't depend on it as it's not designed to absorb higher spikes like those that come from lightning strikes - get a quality power surge protector (not a power strip, but an actual surge protector (they are significantly more expensive than a power strip).
Resetting the NVRAM or SMC will not have any effect.  The NVRAM only holds pre-boot environment variables and the SMC doesn't control this fuse.  For the SMC to function, you need to have power (3 VDC), if the power was cut off (like the fuse did), the SMC is in an off state and won't respond to anything.