Here are the parts:
If you use PayPal, that's all-in-one. They run the card and put in your PayPal account and you don't need the merchant account.
Jason covers the lower layers pretty well. However, for subscription payments there's frequently an additional service - a "subscription processor". Examples in this space are Zuora and Spreedly.
Don't confuse some payment processors ability to do recurring payments with proper subscription processing - there are lots of edge cases around plan upgrades/downgrades, free trials, card changes, etc that the dedicated services do well.
Here are the "parts" in a payments system:
1. A payment gateway - like Authorize.net is one example. There are many others...
2. Merchant Account - This is where the payment processing occurs.
3. Your normal checking account
When your customers enter their credit card information on your shopping cart, the payment gateway provides a mechanism to route that transaction (it depends on your implementation of the shopping cart, but there can be different ways to route - route directly, route through your server, etc.)
Your payment gateway will need to have your Merchant Account information, which is where they will route the information to. This tells your Merchant account provider, your payment processor to process the payment, i.e. charge the credit card of the customer and if approved settle it.. which means they deposit the money into your checking account.
Some providers are a one stop-shop, like the leading banks - BofA, Chase Paymenttech, etc. or you can work with these provider individually. To streamline the process, you might want a single vendor, but the biggest thing to keep in mind more than the $$, is the integration and support.
Hope this helps!