There are a few conditions for it and they will all be clarified on the official pages.
Basically, if you subscribed to YT premium, you could also get 3 months of Nitro for free, making it a win-win situation for users. Similarly, Discord also collaborated with Youtube Premium. Once you clicked on Get on Epic, you will get an email with a gift code that you can use to unlock Nitro free for some time. Such an offer was live until Jand due to its success, chances are that it will be back again.
Sometimes Discord can collab with other platforms, such as Epic Games Store, to give users Discord Nitro for some amount of time.