This type of campaign helps you incentivize the opt-in (for newsletter subscription or a marketing consent) which translates into higher opt-in conversion rates. It also increases the conversion to first purchase, as the discount motivates the subscriber to purchase your products/services.
You could offer the incentive directly in the second opt-in email but it can put your email in the spam folder. Offering the discount on the thank-you page after the second opt-in is a safer option. You can mention the discount on the subscription form before the email opt-ins to avoid using the word discount in your emails.