A regular replace will do it's job when the campaign mail is being prepared. This will only happen once when sending a campaign. There's also a second kind of replacer: Spatie\Mailcoach\Support\Replacers\Replacer\PersonalizedReplacer. These replacer will get executed for each mail that is being sent out in a campaign.
PersonalizedReplacers have access to subscriber they are sent to via the Send object given in the replace method.
Here is the code of the UnsubscribeUrlReplacer that ships with Mailcoach.