Okay, here's the deal: Using your credit card is easy. That's because MasterCard, Visa, Discover, and American Express have worked very hard to make sure you didn't have to do much.
Here's the mnemonic for remembering how it all works: M.A.N.I.C.
That stands for Merchant, Acquirer, Network, Issuer, Customer.
Merchants are, obviously, the people with things they want you to buy. They obtain (buy, rent, lease, whatever) a credit card terminal or e-commerce solution, which is then programmed to connect to an acquirer. (Custom and semi-custom solutions are quite common in this industry.)
Acquirers are generally banks. They provide a group of merchants with connectivity to the credit cards networks, as well as certain other services, such as certifying terminal applications, reporting functions, etc.
Networks are...well...credit card banks. They connect the various banks to one another using their own message standards. (Note that in the case of Discover and I believe American Express, the network and the issuer are the same entity.)
Issuers are the banks that hand out credit cards. They connect to the network(s) and keep track of how much money you have available on your card. (Not how much you've spent. They may not know that, due to situations like restaurant tipping and the rules for dealing with CCs at hotels.) They also send you the credit card bills and charge you interest.
Customers are people buying stuff. That's you.
So here's what happens: Customer walks in Merchant's shop and choose PrettyShinyThing to buy. Merchant rings up merchandise, Customer forks over card. Merchant swipes card through terminal. Terminal verifies that card in not totally bogus (First six digits of credit card number are in a range known to be "valid", check digit is correct, expiration date is not in the past, etc.) Terminal sends authorization request to Acquirer. Acquirer does some other checking on the authorization request, reformats the message and sends it to the appropriate network. Network forwards it to the appropriate issuer. Issuer decides if Customer has enough funds left in their Open To Buy. If so, that amount is deducted from Open To Buy and a response is sent to the network authorizing the transaction. Network routes this back to Acquirer. Acquirer reformats and routes back to the Merchant's terminal. The terminal then prints a receipt for Customer sign. Depending on the setup, the Merchant may need to send in a settlement request at the end of the day, or in some cases this may be unnecessary.
So that's the deal with card credit processing. And I bet thought that it was simple.