They are paid commissions for sales. This way, both sides benefit. The store profits from the sale, and the webmaster gets commissions. There are also pay for clicks programs. They pay you to send visitors to their sites, usually by using banners or text links.
Affiliate programs are usually free to sign up for.
There are a lot, so finding one that fits your web site should be pretty easy. You've probably entered a few contests, whether it was to win cash, cars, or vacations. Some sites give you points you can enter into contests, and others give prizes for winners.