Bicycle racing is a team sport and that is most evident at the Tour de France. Because the level of competition is so high at the Tour you don't win unless you have good team tactics behind you.
Mark Cavendish won stage 5 with good team tactics. His team fulfilled three major roles on the way to victory. First, the team has to protect Mark from the wind and other riders so he can conserve as much energy as possible. That is the energy he will use to power past his competitors in the final few meters.
Secondly, his team must ride a steady, fast tempo at the front of the peloton which ultimately, chases down any breakaways. If there are riders up the road in front of Mark then he is not sprinting for first place.
Lastly, in the final few miles, the team will come to the front to set up the "leadout train". This is, literally, a train of riders with Cavendish the caboose.But, unlike a real train, the goal is for the caboose to cross the line in front of all the other cars in the train.
Most leadout trains have four to six riders including the designated sprinter. The rider at the head of the train will go as hard as he can and when he tires he will pull off. The the next rider will go as hard as he can and pull off. The goal is for the second to last rider in the train to pull off somewhere between 150-200 meters before the finish line so the designated sprinter can power across the line for the win.
Each of the riders in the train pull for between 300 and 500 meters so that means that a really good train takes control of the race with as much as three kilometers remaining. If the run in to the finish is particularly tricky, they might start working even further out.
Mark Cavendish was almost in tears thanking his teammates for their efforts in helping him win stage 5. He knows he could not have done it without them. Now you know why.