It's beneficial for the company because it receives both advertising and sales leads that it wouldn't necessarily be able to access otherwise. It's also beneficial for you and their other affiliate publishers, who are able to make money from sales without actually having to get involved in handling the transaction. Since all you're doing is essentially connecting people with products, affiliate marketing can be one of the most time- and cost-effective methods to make money online. (See also: 5 Ways to Make Passive Income Online)
The problem with affiliate marketing, like many other home business options, are the so-called gurus and get-rich-quick programs that suggest affiliate marketing can be done fast and with little effort. Odds are you've read claims of affiliate marketing programs that say you can make hundreds of thousands of dollars a month doing almost nothing ("Three clicks to rich!"). Or, they suggest you can set up your affiliate site, and then forget it, except to check your bank deposits.