A "precaution" is something you do so that something that might happen, does not happen.
For example, putting candles out before leaving your house is a 'precaution' against starting a fire.
A "prevention" is more a specific action against something that will cause problems. If you see that a candle is setting your curtains on fire, you grab a fire extinguisher and put out the fire. That way you 'prevent' your house from burning down.
The putting out of the fire is a prevention, not a precaution, because the chain of events leading to your house burning down is already in motion and putting out the fire is the act that intends to interrupt the chain of events.