Any processes running in the background, as well as foreground applications, are terminated when either a restart, or a shutdown are executed.
The primary difference between the two is powered state of your hardware.
During a restart, power to your system is not completely cut off. The Operating System handles the restart procedure by closing itself down, and then restarting itself. This is also referred to as a "softboot" or a "warmboot."
During a shutdown, power to your computerIS completely cut fof. The Operating System closes itself down, and cuts all power to the hardware in your system. The power button must be pressed in order to startup the system after this has taken place. This ia also referred tp as a "hardboot" or a "coldboot".