Affiliate software products give companies an ability to reliably track which affiliate sent traffic that generated a sale, in real-time. They also give affiliates the ability to reliably assess how successful their different affiliate campaigns are performing.
The most common ways these software companies track are through cookies.
A company gives its affiliates a tracking link which comes with a unique affiliate ID. When a potential customer (who the affiliate sends) clicks on their link, the affiliate ID is stored on their browser as a cookie for a short period of time, such as 30 days.
This means that even if the customer does not initially purchase but comes back a week later to complete the purchase, the person is still attributed to the original affiliate ID, sometimes even if a 2nd affiliate reaches out to the same person who clicks.
In order for this magic to work, a conversion pixel is placed on the companies thank you page that loads when a customer has purchased. As such, when a person clicks through an affiliate link and eventually reaches the confirmation page, the pixel tracks this event within the affiliate software being used as a sale or lead.
Cookies are normally only tracked within the specific browser, so if the person completes the transaction in a different browser, it will not be tracked.