It's not that simply to answer but briefly said, it's a way of doing business where you have advertisers that want to place their offers and present products and services on different places online, and affiliates that own those sites or social media profiles where they place offers and link that direct to publishers sites. Every time that some users clicks on the link, affiliate gets comission for that action (this also depends of the payment method, is it CPA, CPC, or something else), but they are basically making money that way and publishers earn from clicks and purchases.