Not everyone realizes that cycling is a team sport, but it is because there are some pretty big advantages to working together, due to aerodynamics and race logistics. There are several teams in the tour and each has a couple main sponsors which comprise their team name (Team BMC, Team Sky, Team Nissan Radio Shack, etc.) The first advantage to having a team is aerodynamics. Aerodynamics are not as important at speeds that you and I ride at, but when you average 25-30mph over 120 miles, aerodynamics make a world of a difference. When you have a team, you can all line up behind each other and shift off who the leader in the line is so that people get a break from the wind. The second reason for a team is to take care of the logistics of helping out the main men on the team. For instance, the top rider on the team will stay toward the front of the pack of riders while the lower riders move back and forth between the team car and the lead rider to bring them water and food throughout the stage. On a team there is usually only one or two riders who are going for any of the big prizes. Everyone else is there to help the team leaders win, and they may have the privilege to go for a stage win or two, which is a prestigious thing to win, but probably not the team's main priority.
In the tour, there are 3 main prizes that are to be won. They are the yellow jersey which goes to the person with the overall best time over the tour, the green jersey which basically goes to the best sprinter in the tour, and the polka dot jersey that goes to the best climber in the tour. The yellow jersey is the most coveted prize as it will go to the rider who is the best all-around rider. They must be able to climb and ride a fast time trial (an individual race against the clock). Along many stages there are sprint points and, of course a finish line. There are points available at the sprint points and finish lines for the sprinters who want the green jersey. The man at the end of the tour with the most points wins the jersey. Along the stages there are climbs and the first few men to get to the summit get points towards the polka dot jersey (The king of the mountain).
Each stage is unique. The first several days of the tour have flat stages which favor sprinters, but later in the tour you start to get mountain stages, which make for a much more interesting race. Some stages have flat finish lines, which means a sprinter will win the stage, and others have summit finishes, which means a climber will win the stage. During the race, the majority of the riders will all ride in a pack which is called the Peloton. The peloton is a somewhat easy location to ride because there are so many riders around to block the wind. Because of this, the peloton has the ability to ride very fast together. The downside to the peloton is that the crashes typically happen there and cause huge pile ups. To avoid the pile ups, the top riders will stay towards the front of the group with a few of their teammates to block the wind for them.
During flat stages, the race is all for the sprinters. They will usually stay in the peloton until the sprint points and finish line and then go for the sprint. A good sprinting team will work together to get the sprint for their best sprinter. They do this by creating a Lead-out. Last year, Mark Cavendish's team HTC Colombia was amazing at this. They always had about 3 riders plus Cavendish at the front of the pack. They would pick up the pace all riding in a line. The guy in the front would ride as hard as he could, breaking the wind for his teammates, and then drop out once he couldn't push anymore. The next guy in line would do the same thing, and it would repeat until it was just Cavendish and he would sprint to the finish after getting a head start from the great lead-out. That is how a sprint usually works. Typically at the finish line sprints, everyone who is in the group with a km (or so) to go will get the same time. This prevents and unnecessary dangerous fighting for position in the tight runway.
In many races there will be a few riders that break away from the peloton to either win climb or sprint points or to go for the stage win. This is called a Breakaway. Breakaways are not always successful. If the peloton picks up the pace, they can sometimes catch up to the riders in the breakaway, spoiling all the fun. If the riders in the breakaway are not very important to the riders in the peloton, they will usually be allowed to ride out in front for a while, picking up points at the sprint points and climbs. However, if there is a contender for the yellow jersey (General Contender-GC), somebody in the peloton will probably respond as that is the most important prize. One very interesting breakaway happened the other day when the best sprinter in the tour (read, not a good climber), Peter Sagan, broke away with a group of climbers. The climbers were going for climbing points, but Sagan wanted some sprint points that were to come later in the race and for the possible stage win. He is not a great climber, but he was able to keep up with the climbers for the climb and then easily won the sprint points at the sprint point since he was by far the best sprinter in the small group. The breakaway was successful, in that it made it to the finish line without the peloton catching them, but Sagan could not win the stage as all of us watching were hoping. The climbers knew they had to wear him out before getting within 1km of the finish otherwise he would easily sprint past them for the stage win. It would have been incredibly impressive for a sprinter to be a part of a breakaway that went over a challenging climb and then get the win.
The Time Trial
And finally, there is the time trial. There is a team time trial where each team rides alone and work together to get the best overall team time. In this race, you will see the team working together, pulling each other via aerodynamics. Since this is the most efficient way to ride, this stage has a very high average speed and thus makes the time differences between teams quite small and have little impact on the leader's jersey. The individual time trial is when each individual cyclist rides on their own on a shortish course. The time differences in this stage are also pretty low, but they can still cost you the victory. Last year Cadel Evans went into the time trial on the last day with a pretty bad time deficit, but came back to beat out Andy Schleck for the yellow jersey.
That gives you a decent summary of the sport. It is one of the more interesting forms of racing and once you see that there is more going on than meets the eye and once you start to recognize the riders for their strengths and weaknesses, you can start to appreciate the sport.