My dictionary defines both 防止 and 予防 as "prevention", with 予防 having the additional definitions of "precaution" and "protection against".
I sort of understand the latter definitions for 予防 as acting to stop something which is happening from getting worse, which explains its use in medicine, but I've also seen 予防 used in the "prevention" sense similar to 防止. For example, from the Tanaka Corpus:
The prevention of forest fires is everyone's responsibility.
This is Fire Prevention Week.
We must take measures to prevent traffic accidents.
Defensive driving can help you avoid accidents.
It is essential to prevent salmonella contamination in hen egg production.
Prevention is much preferable to cure. [sic]
In what situations is it preferable to use 防止 over 予防? What are the nuances that govern the choice of one word over the other?