You benefit from the commission and the site benefits from sales it wouldn’t otherwise have made. If you’ve ever gone to a website and seen links to Amazon, those were affiliate links.
Affiliate programs (also called Referral Programs or Partnership Programs) are essentially commission-based sales schemes. You recommend a site to your users and pick up a percentage of any sales those users generate.