When the program loads into memory it carries the virus into memory with it. When the program begins execution it executes the virus subprogram first. Once executed, a virus finds another program and attaches itself again. As with any life form, its imperative is reproduction. But life forms don't only reproduce.
Every life form entertains itself somehow.
If a cold virus merely attached itself to you without making itself known, you probably wouldn't mind it very much. Viruses refuse to keep quiet. They might grab some of your memory. Not much - perhaps a few thousand bytes taken directly from the operating system. The operating system controls all the memory for all other software use, including its own use.