The way I understand it is that Amazon offers an affiliate fee to affiliates. When you don’t go through an affiliate they get to keep the small percentage. Smile was basically Amazon’s own affiliate program that paid out to NGOs. It did reduce their tax liability but it’s not like it’s free money. Assuming a corporate rate of 15%, when Amazon pays a charity $100, they save $15 on taxes. That mean they spent $85, so not exactly tax avoidance unless the charity they donate to is also owned by Amazon or some such.