An affiliate system handles the affiliate accounts by tracking which affiliates have referred visitors to the website, and rewards them with a specific commission based on what the referred visitor did on the website (purchases, sign ups, etc).
Affiliates use the affiliate referral link/URL to promote your website or products. Specific affiliates are tracked because their IDs or usernames are appended to their URL, therefore the system can track which affiliate link brought a customer to your website. If the customer successfully completes a conversion (i.e. a sale, or a form submission), a referral will be generated and the affiliate will be awarded a commission.
For a better understanding of the main Affiliate system workflow check the image below: