Credit card companies giving more rewards for grocery/gas purchases?

Virtually every credit card reward program I’ve come across offers mediocre rewards for most purchases (say 1%) but for grocery store and gas purchases they often offer cash-back rates of 5%. Why? Are they just assuming that these purchases won’t make up a large portion of what the spender uses the card for, or do they get some sort of unknown kickback from these companies?

WAG: Most people would normally write a check (or pay cash, use a debit card, etc.) for these purchases. Giving mediocre rewards makes the customer more likely to use the card for these purchases, and the interest the cards accrue will end up being more than X% that the kickback was.

While this is somewhat true with regards to the interest, what CC companies are really looking for are transactions. The fees the merchant pays (which are passed on to consumers) is a huge source of income for Visa/MC/Amex etc. The rewards are another way of getting you to use your card as opposed to cash, check etc.