Whenever I search for episodes of various TV series, I am wondering why there are different writers and/or directors. See the list of Almost Human Episodes for an example. It doesn't make sense to me that a story started by one person is continued by another person, because it reminds me of the "Storifi" game. So, how does it work? Why are they doing this?
The reason is simple. Money.
Something you may have noticed about shows with multiple writers versus ones with one or two writers is that the former have a lot more episodes than the latter. Having a lot of writers means you can write more story material, which translates to more episodes which (usually) translates to more money.
Another reason is that for most part it is the studio that owns the story and the characters, not the writer(s). So the story gets handled like an asset, and is managed in such a way as to maximize the monetary revenue it generates. So if the studio no longer likes the original writer (not enough revenue, refusing to conform with the studio's master plan, writer got bored with the story, or even plain old politics) it can simply give the story to another writer.
This model is not unique to TV and film studios either. Comics are notorious for this, especially the big two (DC and Marvel).
In some cases I suspect that it's not simply a case of money. In the past I used to help write 'scripts' for LARP events, which are basically like stories. In that case, having a number of writers was very beneficial. Different people had different ideas on how characters would interact with each other and how the story would pan out. If it's a collaborative affair, ie. all the writers get together and throw ideas at each other the atomosphere can become nicely charged and ideas come out that probably would have been difficult if a single person were writing it.
It also (in my case) allowed a group of people with limited abilities to produce story lines that they otherwise wouldn't have thought of.
Another take on this is that distinct groups can write the story for different characters, almost independantly and, when nearly finished, share those ideas with other writers (writing for different characters) and see how the story lines combine and clash. This can lead to some great interplay between characters.
(Also, writing with other people is a lot of fun !)
A writers' room is a collaborative environment. Many people with many ideas pitching in, working off each other, to break the story into specific scenes and acts. Then, someone goes off to write a draft. Others work on drafts for coming episodes. Scripts are always late, later as the season progresses. It takes a lot of people to turn out 26 1 hour scripts of 'quality' in a short time under lots of pressure and long hours. Also, some people are good with dialog, others with plot, others still with computers, guns, action, suspense, gimmicks, etc. McGyver had a separate, credited writer for the show opening and for the show's 4 acts and closer. Depends on the show.