The process of having your bags automatically "forwarded" to your next flight segment is called "through-checking." Whether or not this is possible depends on several factors, such as the airline(s) involved, and the flight segments involved.
As already pointed out, you don't always have to buy both flight segments from the same carrier. Earlier this year I went to Maui using a combination of Continental Airlines and Aloha Airlines, and at LAX Continental had no problems with through checking it to Kahului. I stopped in Honolulu for a few days on the way back, but on a previous trip Aloha had no problems through checking my baggage from Hilo to home via a United flight from Honolulu.
However, in Australia Virgin Blue wouldn't through-check my bags onto Air New Zealand at all. That sucks because Sydney's Kingsford-Smith Airport is among the WORST airports to transit through. The terminals are clean and beautiful and well laid-out, but International and Domestic are NOT walking distance from each other. Even worse, you have to PAY to get from one to the other. You have to pay $4.50 to take a subway train along with all the other Sydney commuters, and the train cars themselves aren't well suited for large baggage (you have to stay in a small area near the doors unless you want to climb stairs, plus there are HUGE gaps between the train cars and the platform). Not fun when you're struggling with a huge Akona dive bag along with your regular luggage. And NO you can't take the trolleys onto the train. Bus is cheaper but then you have to struggle getting luggage onto a bus.
If you buy a trip from a carrier who automatically routes you via an intermediate airport, you can pretty much bet that your baggage will be automatically through-checked, with the exception noted below.
One type of flight where you CANNOT through-check is if you are coming back into the US at an international airport (LAX, SFO, JFK, Chicago O'Hare, Washington-Dulles, etc.) and have to take a connecting flight to another airport. Homeland Security rules say that you have to pick up your bags at the international port of entry, and re-check the bags for your next flight segment. Some airlines such as United make this process less painful by having a special "transit" area where you pick up your bags and drop them off at another carousel in the same area; at O'Hare's United transit area the two carousels are literally steps apart.