here is how a credit card works: the teenage brats "borrow" my credit cards for weird stuff like gas, gummy bears, movie tickets, ball game tickets, parking tickets, pizzas, sodas, goofy t-shirts, and other life essentials. the credit card company bills ME for their transgressions..and if I don't hurry up and pay it online I gotta pay them something stupid called interest!! YIKES! so I sit at my computer 24/7 and watch for these disasters to invade my computer screen and pay them like a fool. why we actually love kids is way beyond me...;-)
It's like getting a loan. If you don't have cash with you or not enough cash to buy something, the credit card is willing to pay for you as long as you pay the credit card company back. If you cannot pay the full amount when it is due, the credit card company will charge interest on the money you owe. Also, the credit card company makes money from the store when you use it.
bubalu's answer is what I would say, too, it's basically a short term loan from the credit card company - they pay the bill for you and then you pay them back later. The main difference is that they also bill the merchant about 4% of the purchase for using the card, that way if you pay in full each month so that you pay no interest, they still make money. What a racket!!