Lifelink works by causing life gain equal to the damage a source deals (CR 702.15b). The operative word is dealt: lifelink only generates life gain when damage is actually dealt. Prevention effects stop damage before it is ever dealt, so there is nothing for lifelink to act on.
CR 615.1 explains that prevention effects replace the event of damage being dealt. If damage is prevented, it simply does not happen — it is replaced by nothing. Because no damage is dealt, the lifelink condition is never satisfied, and no life is gained.
This is different from damage being reduced to zero or redirected; prevention specifically removes the damage from the game before it can produce any results, including lifelink's life gain, death-touch's destroy effect, or infect's counter placement.
Concrete example: Your opponent attacks with a 3/3 creature with lifelink. You cast Fog of Gnats-style prevention, preventing all combat damage this turn. The 3/3 deals no damage — your opponent gains zero life from lifelink, even though the creature would normally grant 3 life.
If only some damage is prevented (e.g., a shield that prevents 2 of the 3 damage), lifelink only triggers for the 1 damage that is actually dealt, so your opponent gains only 1 life (CR 702.15b, 615.1).
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.