Actually, there's no such thing as "deploying a Web part to a site collection". You deploy a Web part with a WSP package; WSP packages (at least ones that contain Web parts) are deployed against specific Web applications. After that the feature containing the Web part is activated per site collection, but "activating a feature" is only a SharePoint logic (i.e. database only) operation, no technical step is made here.
Thus, the real technical deployment happens when you deploy (Install-SPSolution
or from the Central Administration) the WSP. Here, "deploying" means copying/pasting files at correct locations. Most of the time (and especially when the WSP contains a Web part) the package contains a DLL (.NET assembly) that's deployed into the GAC (most of the time; could also be deployed into the Web application' bin folder, I'll come to that later).
When a DLL is in the GAC, any process can access and load it. However, the .NET design makes a GACed DLL "un-reloadable" for the entire process-life. It means that if the DLL is changed in the GAC, the process cannot reload the new version until it's restarted. That's a .NET design, not SharePoint's.
That's why SharePoint "decides" to restart the pool (meaning it also restarts all Web applications contained in that pool) to ensure the new version of the DLL is immediatley used (and synced with other updates made in the hive).
That's why, when you update a solution, you have the option to schedule the operation for a later time (-Time
parameter) in order for the downtime to occur by night for example.
And that's also a good reason to set your Web applications in dedicated pools.
And also, that's why you can decide to deploy your WSP in "bin mode": you don't put the DLL into the GAC, but into the bin folder of the Web application. You take that decision as a developper, when you create the package in Visual Studio (see the design window of the "package" node). A DLL from the bin folder can be updated live.
And a last note: if your WSP contains a job or a workflow, it means your code may be loaded by the SharePoint Timer service (owstimer.exe). In that case, you must put the DLL into the GAC (not the bin folder of each Web application), so the service can access it. This also means you must restart manually this service after each WSP update (unfortunately, and for a reason I can't understand SharePoint does not restart the service on it own). And this must be done on each server of the farm.