The system use to be simple until Visa and MastarCard cornered the market and started demanding more and more percentage/fees from merchants. Of course, merchants like Wal-Mart and Safeway have negotiations power unlike the mom and pop shop so they get a more favorable deal. Small merchants no longer have a choice but to pass on the cost unless they want to give 2% to 3% of the cost of goods to Visa/MasterCard.
A legislation was put forth to limit Swipe Fees and passed last year but it is only for debit card fees (gee, I wonder why?).
Retailers score in swipe fee fight with credit card giants - Jun. 23, 2010
p.s. Visa and MasterCard are ripe to be supplanted by something like
Google Wallet through Paypal or Google checkout. I hope it takes off.