Sketch resumption after power loss

If I have the arduino connected to the PC with the sketch uploaded and running, and then I disconnect the USB cable, obviously everything stops. If I then reconnect the USB cable, the sketch starts running again without any action on my part. Although, I'm not sure where exactly which line the sketch resumes from. Thanks