Affiliate programs

What is affiliate marketing and how does it work?