In 2008 the state of New York passed a law asserting sales tax jurisdiction over Amazon.com sales to New York residents. New York was aware of Amazon affiliates operating within the state. In Quill Corp. v. North Dakota, the US Supreme Court ruled that the presence of independent sales representatives may allow a state to require sales tax collections. New York determined that affiliates are such independent sales representatives. The New York law became known as "Amazon's law" and was quickly emulated by other states. While that was the first time states successfully addressed the internet tax gap, since 2018 states have been free to assert sales tax jurisdiction over sales to their residents regardless of the presence of retailer affiliates.
Affiliate marketing is also called "performance marketing", in reference to how sales employees are typically being compensated. Such employees are typically paid a commission for each sale they close, and sometimes are paid performance incentives for exceeding objectives. Affiliates are not employed by the advertiser whose products or services they promote, but the compensation models applied to affiliate marketing are very similar to the ones used for people in the advertisers' internal sales department.
This relationship can take multiple forms. You may partner with a brand launching a specific product and receive a percentage of the revenue generated by your referrals. Or, if you work with websites like Amazon, you receive a percentage of whatever purchase a follower makes through your referral links, even if they don't buy the product you were specifically recommending.