Cookies are small text files with information about the website visitor: what device they are using, how they found a website, how long they stayed there, and what pages they looked at, etc.
Cookies are mainly used for personalization. They tell the websites what content you like or what items you have viewed. Based on that information, it will suggest entries that correspond to your interests and recommend products that you needed all this time.
In affiliate marketing, they have a different role though. As soon as a user clicks the affiliate link, their information is transferred to the advertiser. It helps advertisers to personalize the user’s experience. Yet, it also provides affiliates with fair payment if they are paid for conversions or sales.
Very few users convert or buy from the first visit. They may need three or more page views before they make a decision. However, the affiliate was the primary reason why they got to know about the website and later converted. Cookies help to track such visitors who initially came from the affiliate but made the conversion later in order to pay the affiliate for their honest work.
At the same time, many users have privacy concerns about cookies and start to reject their usage.